mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Introduce missing non-const cast-operator on structs and unions. (#250)
This commit is contained in:
parent
e48f8f99a3
commit
77ff84f711
@ -4710,11 +4710,16 @@ void VulkanHppGenerator::writeTypeStruct(std::ostream & os, DependencyData const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// the cast-operator to the wrapped struct
|
// the implicit cast-operators to the native type
|
||||||
os << " operator const Vk" << dependencyData.name << "&() const" << std::endl
|
os << " operator Vk" << dependencyData.name << " const&() const" << std::endl
|
||||||
<< " {" << std::endl
|
<< " {" << std::endl
|
||||||
<< " return *reinterpret_cast<const Vk" << dependencyData.name << "*>(this);" << std::endl
|
<< " return *reinterpret_cast<const Vk" << dependencyData.name << "*>(this);" << std::endl
|
||||||
<< " }" << std::endl
|
<< " }" << std::endl
|
||||||
|
<< std::endl
|
||||||
|
<< " operator Vk" << dependencyData.name << " &()" << std::endl
|
||||||
|
<< " {" << std::endl
|
||||||
|
<< " return *reinterpret_cast<Vk" << dependencyData.name << "*>(this);" << std::endl
|
||||||
|
<< " }" << std::endl
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
// operator==() and operator!=()
|
// operator==() and operator!=()
|
||||||
@ -4879,11 +4884,16 @@ void VulkanHppGenerator::writeTypeUnion(std::ostream & os, DependencyData const&
|
|||||||
writeStructSetter(os, dependencyData.name, it->second.members[i]);
|
writeStructSetter(os, dependencyData.name, it->second.members[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// the implicit cast operator to the native type
|
// the implicit cast operators to the native type
|
||||||
os << " operator Vk" << dependencyData.name << " const& () const" << std::endl
|
os << " operator Vk" << dependencyData.name << " const&() const" << std::endl
|
||||||
<< " {" << std::endl
|
<< " {" << std::endl
|
||||||
<< " return *reinterpret_cast<const Vk" << dependencyData.name << "*>(this);" << std::endl
|
<< " return *reinterpret_cast<const Vk" << dependencyData.name << "*>(this);" << std::endl
|
||||||
<< " }" << std::endl
|
<< " }" << std::endl
|
||||||
|
<< std::endl
|
||||||
|
<< " operator Vk" << dependencyData.name << " &()" << std::endl
|
||||||
|
<< " {" << std::endl
|
||||||
|
<< " return *reinterpret_cast<Vk" << dependencyData.name << "*>(this);" << std::endl
|
||||||
|
<< " }" << std::endl
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
|
|
||||||
// the union member variables
|
// the union member variables
|
||||||
|
2401
vulkan/vulkan.hpp
2401
vulkan/vulkan.hpp
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user