3#if _cpp_lib_inplace_vector >= 202406L
5#include <inplace_vector>
14template <
typename T,
size_t N>
15using InplaceStack = std::stack<T, std::inplace_vector<T, N>>;
27template <
typename T,
size_t N>
31 const T&
top()
const { assert( size_ > 0 );
return data_[size_-1]; }
32 T&
top() { assert( size_ > 0 );
return data_[size_-1]; }
34 bool empty()
const {
return size_ == 0; }
35 size_t size()
const {
return size_; }
37 void push(
const T& value ) { assert( size_ < N ); data_[size_++] = value; }
38 void push( T&& value ) { assert( size_ < N ); data_[size_++] = std::move( value ); }
40 void pop() { assert( size_ > 0 ); size_--; }
43 std::array<T, N> data_;
Container class implementing in-place static sized stack.
Definition MRInplaceStack.h:29
const T & top() const
Definition MRInplaceStack.h:31
void pop()
Definition MRInplaceStack.h:40
bool empty() const
Definition MRInplaceStack.h:34
size_t size() const
Definition MRInplaceStack.h:35
void push(const T &value)
Definition MRInplaceStack.h:37
void push(T &&value)
Definition MRInplaceStack.h:38
T & top()
Definition MRInplaceStack.h:32
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8