12 #include <type_traits>
13 #include <boost/type_traits.hpp>
16 inline namespace v_100 {
28 template <
typename T,
unsigned MaxSize>
30 static_assert(boost::has_trivial_assign<T>::value,
"T must be trivially copyable");
31 static_assert(boost::has_trivial_destructor<T>::value,
"T must be trivially destroyable");
38 static const size_t max_size = MaxSize;
44 bool push(T v) noexcept
46 if (pos_ < static_cast<int>(MaxSize) - 1) {
48 elements_[pos_] = std::move(v);
54 bool pop(T &v) noexcept
57 v = std::move(elements_[pos_]);
64 bool empty()
const noexcept
72 using namespace v_100;