Introduce usage of [[nodiscard]] with C++17

This commit is contained in:
asuessenbach
2020-07-15 08:55:47 +02:00
committed by Markus Tavenrath
parent 43df4dd0f1
commit 4cdc51ba0f
21 changed files with 2455 additions and 1818 deletions

View File

@@ -346,6 +346,10 @@ Finally, the last code example is using exceptions and return value transformati
Keep in mind that Vulkan-Hpp does not support RAII style handles and that you have to cleanup your resources in the error handler!
### C++17: [[nodiscard]]
With C++17 and above, some functions are attributed with [[nodiscard]], resulting in a warning if you don't use the return value in any way. You can switch those warnings off by defining VULKAN_HPP_NO_NODISCARD_WARNINGS.
### Enumerations
For the return value transformation, there's one special class of return values which require special handling: Enumerations. For enumerations you usually have to write code like this: