File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11#pragma once
22#include " xr_vector.h"
3+ // #include <stack>
34
5+ // XXX: Use standard implementation?
6+ // template <typename T, class container = xr_vector<T>>
7+ // using xr_stack = std::stack<T, container>;
8+
9+ // XXX: Use profiler or something to know if this is faster than std::stack
410template <typename _Ty, class _C = xr_vector<_Ty>>
511class xr_stack
612{
@@ -12,9 +18,11 @@ class xr_stack
1218
1319 allocator_type get_allocator () const { return c.get_allocator (); }
1420 bool empty () const { return c.empty (); }
15- u32 size () const { return c.size (); }
21+ size_type size () const { return c.size (); }
1622 value_type& top () { return c.back (); }
1723 const value_type& top () const { return c.back (); }
24+ void emplace (value_type&& _X) { c.emplace_back (_X); }
25+ void push (value_type&& _X) { c.push_back (std::move (_X)); }
1826 void push (const value_type& _X) { c.push_back (_X); }
1927 void pop () { c.pop_back (); }
2028 bool operator ==(const _Myt& _X) const { return c == _X.c ; }
You can’t perform that action at this time.
0 commit comments