template class ArrayWrapper1D : public std::array { public: VULKAN_HPP_CONSTEXPR ArrayWrapper1D() VULKAN_HPP_NOEXCEPT : std::array() {} VULKAN_HPP_CONSTEXPR ArrayWrapper1D( std::array const & data ) VULKAN_HPP_NOEXCEPT : std::array( data ) {} template ::value, int>::type = 0> VULKAN_HPP_CONSTEXPR_14 ArrayWrapper1D( std::string const & data ) VULKAN_HPP_NOEXCEPT { copy( data.data(), data.length() ); } #if 17 <= VULKAN_HPP_CPP_VERSION template ::value, int>::type = 0> VULKAN_HPP_CONSTEXPR_14 ArrayWrapper1D( std::string_view data ) VULKAN_HPP_NOEXCEPT { copy( data.data(), data.length() ); } #endif #if ( VK_USE_64_BIT_PTR_DEFINES == 0 ) // on 32 bit compiles, needs overloads on index type int to resolve ambiguities VULKAN_HPP_CONSTEXPR T const & operator[]( int index ) const VULKAN_HPP_NOEXCEPT { return std::array::operator[]( index ); } T & operator[]( int index ) VULKAN_HPP_NOEXCEPT { return std::array::operator[]( index ); } #endif operator T const *() const VULKAN_HPP_NOEXCEPT { return this->data(); } operator T *() VULKAN_HPP_NOEXCEPT { return this->data(); } template ::value, int>::type = 0> operator std::string() const { return std::string( this->data(), strnlen( this->data(), N ) ); } #if 17 <= VULKAN_HPP_CPP_VERSION template ::value, int>::type = 0> operator std::string_view() const { return std::string_view( this->data(), strnlen( this->data(), N ) ); } #endif private: VULKAN_HPP_CONSTEXPR_14 void copy( char const * data, size_t len ) VULKAN_HPP_NOEXCEPT { size_t n = std::min( N - 1, len ); for ( size_t i = 0; i < n; ++i ) { ( *this )[i] = data[i]; } ( *this )[n] = 0; } }; // relational operators between ArrayWrapper1D of chars with potentially different sizes #if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) template std::strong_ordering operator<=>( ArrayWrapper1D const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { int result = strcmp( lhs.data(), rhs.data() ); return ( result < 0 ) ? std::strong_ordering::less : ( ( result > 0 ) ? std::strong_ordering::greater : std::strong_ordering::equal ); } #else template bool operator<( ArrayWrapper1D const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { return strcmp( lhs.data(), rhs.data() ) < 0; } template bool operator<=( ArrayWrapper1D const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { return strcmp( lhs.data(), rhs.data() ) <= 0; } template bool operator>( ArrayWrapper1D const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { return strcmp( lhs.data(), rhs.data() ) > 0; } template bool operator>=( ArrayWrapper1D const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { return strcmp( lhs.data(), rhs.data() ) >= 0; } #endif template bool operator==( ArrayWrapper1D const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { return strcmp( lhs.data(), rhs.data() ) == 0; } template bool operator!=( ArrayWrapper1D const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { return strcmp( lhs.data(), rhs.data() ) != 0; } // specialization of relational operators between std::string and arrays of chars #if defined( VULKAN_HPP_HAS_SPACESHIP_OPERATOR ) template std::strong_ordering operator<=>( std::string const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { return lhs <=> rhs.data(); } #else template bool operator<( std::string const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { return lhs < rhs.data(); } template bool operator<=( std::string const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { return lhs <= rhs.data(); } template bool operator>( std::string const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { return lhs > rhs.data(); } template bool operator>=( std::string const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { return lhs >= rhs.data(); } #endif template bool operator==( std::string const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { return lhs == rhs.data(); } template bool operator!=( std::string const & lhs, ArrayWrapper1D const & rhs ) VULKAN_HPP_NOEXCEPT { return lhs != rhs.data(); }