def makeRefUtilImpl():
    (yield 'namespace refdetails')
    (yield '{')
    (yield '')
    for function in api.functions:
        if ((function.getType() == Function.TYPE_DEVICE) and ((function.name[:9] == 'vkDestroy') or (function.name == 'vkFreeMemory')) and (not (function.name == 'vkDestroyDevice')) and (not function.isAlias)):
            objectType = function.arguments[(- 2)].getType()
            (yield 'template<>')
            (yield ('void Deleter<%s>::operator() (%s obj) const' % (objectType, objectType)))
            (yield '{')
            (yield ('\tm_deviceIface->%s(m_device, obj, m_allocator);' % getInterfaceName(function)))
            (yield '}')
            (yield '')
    (yield '} // refdetails')
    (yield '')
    dtorDict = {Function.TYPE_PLATFORM: 'object', Function.TYPE_INSTANCE: 'instance', Function.TYPE_DEVICE: 'device'}
    for function in functions:
        deleterArgsString = ''
        if (function.name == 'createDevice'):
            deleterArgsString = ('vkp, instance, object, ' + function.arguments[(- 1)].name)
        else:
            deleterArgsString = ('vk, %s, %s' % (dtorDict[function.type], function.arguments[(- 1)].name))
        (yield ('Move<%s> %s (%s)' % (function.objectType, function.name, argListToStr((function.ifaceArgs + function.arguments)))))
        (yield '{')
        (yield ('\t%s object = 0;' % function.objectType))
        (yield ('\tVK_CHECK(vk.%s(%s));' % (function.name, ', '.join(([a.name for a in function.arguments] + ['&object'])))))
        (yield ('\treturn Move<%s>(check<%s>(object), Deleter<%s>(%s));' % (function.objectType, function.objectType, function.objectType, deleterArgsString)))
        (yield '}')
        (yield '')
def makeRefUtilImpl():
    (yield 'namespace refdetails')
    (yield '{')
    (yield )
    for function in api.functions:
        if ((function.getType() == Function.TYPE_DEVICE) and ((function.name[:9] == 'vkDestroy') or (function.name == 'vkFreeMemory')) and (not (function.name == 'vkDestroyDevice')) and (not function.isAlias)):
            objectType = function.arguments[(- 2)].getType()
            (yield 'template<>')
            (yield ('void Deleter<%s>::operator() (%s obj) const' % (objectType, objectType)))
            (yield '{')
            (yield ('\tm_deviceIface->%s(m_device, obj, m_allocator);' % getInterfaceName(function)))
            (yield '}')
            (yield )
    (yield '} // refdetails')
    (yield )
    dtorDict = {Function.TYPE_PLATFORM: 'object', Function.TYPE_INSTANCE: 'instance', Function.TYPE_DEVICE: 'device'}
    for function in functions:
        deleterArgsString = 
        if (function.name == 'createDevice'):
            deleterArgsString = ('vkp, instance, object, ' + function.arguments[(- 1)].name)
        else:
            deleterArgsString = ('vk, %s, %s' % (dtorDict[function.type], function.arguments[(- 1)].name))
        (yield ('Move<%s> %s (%s)' % (function.objectType, function.name, argListToStr((function.ifaceArgs + function.arguments)))))
        (yield '{')
        (yield ('\t%s object = 0;' % function.objectType))
        (yield ('\tVK_CHECK(vk.%s(%s));' % (function.name, ', '.join(([a.name for a in function.arguments] + ['&object'])))))
        (yield ('\treturn Move<%s>(check<%s>(object), Deleter<%s>(%s));' % (function.objectType, function.objectType, function.objectType, deleterArgsString)))
        (yield '}')
        (yield )