Reintroduce ArrayProxy constructors with std::array and std::vector

This commit is contained in:
asuessenbach 2020-05-05 11:34:02 +02:00
parent f56e99e5b8
commit f15f2f382b
2 changed files with 92 additions and 16 deletions

View File

@ -6772,16 +6772,52 @@ int main( int argc, char ** argv )
, m_ptr(list.begin())
{}
template <typename Container>
ArrayProxy(Container const& container) VULKAN_HPP_NOEXCEPT
: m_count(static_cast<uint32_t>(container.size()))
, m_ptr(container.data())
template <size_t N>
ArrayProxy(std::array<T, N> const & data) VULKAN_HPP_NOEXCEPT
: m_count(N)
, m_ptr(data.data())
{}
template <typename Container>
ArrayProxy(Container & container) VULKAN_HPP_NOEXCEPT
: m_count(static_cast<uint32_t>(container.size()))
, m_ptr(container.data())
template <size_t N, typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy(std::array<typename std::remove_const<T>::type, N> const & data) VULKAN_HPP_NOEXCEPT
: m_count(N)
, m_ptr(data.data())
{}
template <size_t N>
ArrayProxy(std::array<T, N> & data) VULKAN_HPP_NOEXCEPT
: m_count(N)
, m_ptr(data.data())
{}
template <size_t N, typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy(std::array<typename std::remove_const<T>::type, N> & data) VULKAN_HPP_NOEXCEPT
: m_count(N)
, m_ptr(data.data())
{}
template <class Allocator = std::allocator<typename std::remove_const<T>::type>>
ArrayProxy(std::vector<T, Allocator> const & data) VULKAN_HPP_NOEXCEPT
: m_count(static_cast<uint32_t>(data.size()))
, m_ptr(data.data())
{}
template <class Allocator = std::allocator<typename std::remove_const<T>::type>, typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy(std::vector<typename std::remove_const<T>::type, Allocator> const& data) VULKAN_HPP_NOEXCEPT
: m_count(static_cast<uint32_t>(data.size()))
, m_ptr(data.data())
{}
template <class Allocator = std::allocator<typename std::remove_const<T>::type>>
ArrayProxy(std::vector<T, Allocator> & data) VULKAN_HPP_NOEXCEPT
: m_count(static_cast<uint32_t>(data.size()))
, m_ptr(data.data())
{}
template <class Allocator = std::allocator<typename std::remove_const<T>::type>, typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy(std::vector<typename std::remove_const<T>::type, Allocator> & data) VULKAN_HPP_NOEXCEPT
: m_count(static_cast<uint32_t>(data.size()))
, m_ptr(data.data())
{}
const T * begin() const VULKAN_HPP_NOEXCEPT

View File

@ -246,16 +246,56 @@ namespace VULKAN_HPP_NAMESPACE
, m_ptr( list.begin() )
{}
template <typename Container>
ArrayProxy( Container const & container ) VULKAN_HPP_NOEXCEPT
: m_count( static_cast<uint32_t>( container.size() ) )
, m_ptr( container.data() )
template <size_t N>
ArrayProxy( std::array<T, N> const & data ) VULKAN_HPP_NOEXCEPT
: m_count( N )
, m_ptr( data.data() )
{}
template <typename Container>
ArrayProxy( Container & container ) VULKAN_HPP_NOEXCEPT
: m_count( static_cast<uint32_t>( container.size() ) )
, m_ptr( container.data() )
template <size_t N, typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy( std::array<typename std::remove_const<T>::type, N> const & data ) VULKAN_HPP_NOEXCEPT
: m_count( N )
, m_ptr( data.data() )
{}
template <size_t N>
ArrayProxy( std::array<T, N> & data ) VULKAN_HPP_NOEXCEPT
: m_count( N )
, m_ptr( data.data() )
{}
template <size_t N, typename B = T, typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy( std::array<typename std::remove_const<T>::type, N> & data ) VULKAN_HPP_NOEXCEPT
: m_count( N )
, m_ptr( data.data() )
{}
template <class Allocator = std::allocator<typename std::remove_const<T>::type>>
ArrayProxy( std::vector<T, Allocator> const & data ) VULKAN_HPP_NOEXCEPT
: m_count( static_cast<uint32_t>( data.size() ) )
, m_ptr( data.data() )
{}
template <class Allocator = std::allocator<typename std::remove_const<T>::type>,
typename B = T,
typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy( std::vector<typename std::remove_const<T>::type, Allocator> const & data ) VULKAN_HPP_NOEXCEPT
: m_count( static_cast<uint32_t>( data.size() ) )
, m_ptr( data.data() )
{}
template <class Allocator = std::allocator<typename std::remove_const<T>::type>>
ArrayProxy( std::vector<T, Allocator> & data ) VULKAN_HPP_NOEXCEPT
: m_count( static_cast<uint32_t>( data.size() ) )
, m_ptr( data.data() )
{}
template <class Allocator = std::allocator<typename std::remove_const<T>::type>,
typename B = T,
typename std::enable_if<std::is_const<B>::value, int>::type = 0>
ArrayProxy( std::vector<typename std::remove_const<T>::type, Allocator> & data ) VULKAN_HPP_NOEXCEPT
: m_count( static_cast<uint32_t>( data.size() ) )
, m_ptr( data.data() )
{}
const T * begin() const VULKAN_HPP_NOEXCEPT