Vulkan-Hpp/snippets/Exchange.hpp
Nikolai Siukosev ae1eb5f449
Non raii handles move exchange (#1929)
* Add move semantics for non-raii hpp handles. (#1919)

* Updated generated vulkan/* files
2024-07-23 09:55:09 +02:00

12 lines
298 B
C++

#if ( 14 <= VULKAN_HPP_CPP_VERSION )
using std::exchange;
#else
template <class T, class U = T>
VULKAN_HPP_CONSTEXPR_14 VULKAN_HPP_INLINE T exchange( T & obj, U && newValue )
{
T oldValue = std::move( obj );
obj = std::forward<U>( newValue );
return oldValue;
}
#endif