Refactor top-level function to generate vulkan.hpp

This commit is contained in:
asuessenbach
2022-07-28 17:09:08 +02:00
parent b95c02b89d
commit 893d6847bb
24 changed files with 2223 additions and 2226 deletions

33
snippets/Optional.hpp Normal file
View File

@@ -0,0 +1,33 @@
template <typename RefType>
class Optional
{
public:
Optional( RefType & reference ) VULKAN_HPP_NOEXCEPT
{
m_ptr = &reference;
}
Optional( RefType * ptr ) VULKAN_HPP_NOEXCEPT
{
m_ptr = ptr;
}
Optional( std::nullptr_t ) VULKAN_HPP_NOEXCEPT
{
m_ptr = nullptr;
}
operator RefType *() const VULKAN_HPP_NOEXCEPT
{
return m_ptr;
}
RefType const * operator->() const VULKAN_HPP_NOEXCEPT
{
return m_ptr;
}
explicit operator bool() const VULKAN_HPP_NOEXCEPT
{
return !!m_ptr;
}
private:
RefType * m_ptr;
};