6#include <bond/core/config.h>
8#include <boost/static_assert.hpp>
20template <
typename T, u
int32_t N = 64>
29 BOOST_STATIC_ASSERT(N != 0);
42 const T* begin()
const
51 throw std::underflow_error(
"Can't pop empty array");
53 return _data[--_size];
56 T& operator[](uint32_t i)
63 if (_size < _capacity)
73 if (_capacity >= ((std::numeric_limits<uint32_t>::max)() >> 1))
75 throw std::bad_alloc();
78 T* new_data =
new T[_capacity <<= 1];
79 memcpy(new_data, _data, _size *
sizeof(T));
81 (_data = new_data)[_size++] = x;
93 BOOST_STATIC_ASSERT(std::is_pod<T>::value);
namespace bond
Definition: apply.h:17