mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Change readme example to catch std::exception (#4)
There are two reasons for this change. 1) The C++ mantra "throw by value, catch by reference" still applies, even when you're only specifically throwing std::system_error at this time 2) Vulkan-Hpp is using C++ stdlib containers, such as std::string and std::vector, which have their own exception specifications to consider. The example provided may throw various exceptions, all of which derive from std::exception, and many will not be std::system_error. This is a serious issue in the readme simply because that snippet of code will be the copy/pasted foundation of many projects which adopt Vulkan-Hpp. We might as well try to avoid some common pitfalls of exception handling.
This commit is contained in:
parent
e1703832d8
commit
6740df4faf
Loading…
Reference in New Issue
Block a user