diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 64247df..d4f66b1 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -4604,8 +4604,8 @@ int main( int argc, char **argv ) { private: using Deleter = typename UniqueHandleTraits::deleter; - public: + public: using element_type = Type; explicit UniqueHandle( Type const& value = Type(), Deleter const& deleter = Deleter() ) @@ -4695,6 +4695,14 @@ int main( int argc, char **argv ) Type m_value; }; + template + VULKAN_HPP_INLINE std::vector uniqueToRaw(std::vector const& handles) + { + std::vector newBuffer(handles.size()); + std::transform(handles.begin(), handles.end(), newBuffer.begin(), [](UniqueType const& handle) { return handle.get(); }); + return newBuffer; + } + template VULKAN_HPP_INLINE void swap( UniqueHandle & lhs, UniqueHandle & rhs ) { diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index a3a4823..ec59e0a 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -508,8 +508,8 @@ namespace VULKAN_HPP_NAMESPACE { private: using Deleter = typename UniqueHandleTraits::deleter; - public: + public: using element_type = Type; explicit UniqueHandle( Type const& value = Type(), Deleter const& deleter = Deleter() ) @@ -599,6 +599,14 @@ namespace VULKAN_HPP_NAMESPACE Type m_value; }; + template + VULKAN_HPP_INLINE std::vector uniqueToRaw(std::vector const& handles) + { + std::vector newBuffer(handles.size()); + std::transform(handles.begin(), handles.end(), newBuffer.begin(), [](UniqueType const& handle) { return handle.get(); }); + return newBuffer; + } + template VULKAN_HPP_INLINE void swap( UniqueHandle & lhs, UniqueHandle & rhs ) {