mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Merge pull request #7 from asuessenbach/extentArrayProxy
Add member functions begin(), end(), front(), back(), and empty() to vk::ArrayProxy to make it a better container.
This commit is contained in:
commit
5c5a00110e
@ -270,6 +270,33 @@ std::string const arrayProxyHeader = (
|
||||
" , m_ptr(data.begin())\n"
|
||||
" {}\n"
|
||||
"\n"
|
||||
" const T * begin() const\n"
|
||||
" {\n"
|
||||
" return m_ptr;\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
" const T * end() const\n"
|
||||
" {\n"
|
||||
" return m_ptr + m_count;\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
" const T & front() const\n"
|
||||
" {\n"
|
||||
" assert(m_count && m_ptr);\n"
|
||||
" return *m_ptr;\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
" const T & back() const\n"
|
||||
" {\n"
|
||||
" assert(m_count && m_ptr);\n"
|
||||
" return *(m_ptr + m_count - 1);\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
" bool empty() const\n"
|
||||
" {\n"
|
||||
" return (m_count == 0);\n"
|
||||
" }\n"
|
||||
"\n"
|
||||
" uint32_t size() const\n"
|
||||
" {\n"
|
||||
" return m_count;\n"
|
||||
|
@ -264,6 +264,33 @@ namespace vk
|
||||
, m_ptr(data.begin())
|
||||
{}
|
||||
|
||||
const T * begin() const
|
||||
{
|
||||
return m_ptr;
|
||||
}
|
||||
|
||||
const T * end() const
|
||||
{
|
||||
return m_ptr + m_count;
|
||||
}
|
||||
|
||||
const T & front() const
|
||||
{
|
||||
assert(m_count && m_ptr);
|
||||
return *m_ptr;
|
||||
}
|
||||
|
||||
const T & back() const
|
||||
{
|
||||
assert(m_count && m_ptr);
|
||||
return *(m_ptr + m_count - 1);
|
||||
}
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
return (m_count == 0);
|
||||
}
|
||||
|
||||
uint32_t size() const
|
||||
{
|
||||
return m_count;
|
||||
|
Loading…
Reference in New Issue
Block a user