Merge pull request #850 from asuessenbach/flags

Introduce configuration flag VULKAN_HPP_FLAGS_MASK_TYPE_AS_PUBLIC.
This commit is contained in:
Andreas Süßenbach 2021-01-12 11:49:12 +01:00 committed by GitHub
commit 822bcdcb4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 468 additions and 456 deletions

View File

@ -532,6 +532,10 @@ This either selects the dynamic (when it's 1) or the static (when it's not 1) Di
By default, a little helper class ```DynamicLoader``` is used to dynamically load the vulkan library. If you set it to something different than 1 before including vulkan.hpp, this helper is not available, and you need to explicitly provide your own loader type for the function ```DispatchLoaderDynamic::init()```.
#### VULKAN_HPP_FLAGS_MASK_TYPE_AS_PUBLIC
By default, the member ```m_mask``` of the ```Flags``` template class is private. This is to prevent accidentally setting a ```Flags``` with some inappropriate value. But it also prevents using a ```Flags```, or a structure holding a ```Flags```, to be used as a non-type template parameter. If you really need that functionality, and accept the reduced security, you can use this define to change the access specifier for m_mask from private to public, which allows using a ```Flags``` as a non-type template parameter.
#### VULKAN_HPP_INLINE
This is set to be the compiler-dependent attribute used to mark functions as inline. If your compiler happens to need some different attribute, you can set this define accordingly before including vulkan.hpp.

View File

@ -10250,7 +10250,11 @@ int main( int argc, char ** argv )
return m_mask;
}
#if defined(VULKAN_HPP_FLAGS_MASK_TYPE_AS_PUBLIC)
public:
#else
private:
#endif
MaskType m_mask;
};

View File

@ -777,7 +777,11 @@ namespace VULKAN_HPP_NAMESPACE
return m_mask;
}
#if defined( VULKAN_HPP_FLAGS_MASK_TYPE_AS_PUBLIC )
public:
#else
private:
#endif
MaskType m_mask;
};