Merge pull request #597 from asuessenbach/ArrayProxy

Reintroduce ArrayProxy constructors with std::array and std::vector
This commit is contained in:
Andreas Süßenbach 2020-05-05 13:50:49 +02:00 committed by GitHub
commit 94c33a5e2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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