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 1
1
#pragma once
2
2
#include " xr_vector.h"
3
+ // #include <stack>
3
4
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
4
10
template <typename _Ty, class _C = xr_vector<_Ty>>
5
11
class xr_stack
6
12
{
@@ -12,9 +18,11 @@ class xr_stack
12
18
13
19
allocator_type get_allocator () const { return c.get_allocator (); }
14
20
bool empty () const { return c.empty (); }
15
- u32 size () const { return c.size (); }
21
+ size_type size () const { return c.size (); }
16
22
value_type& top () { return c.back (); }
17
23
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)); }
18
26
void push (const value_type& _X) { c.push_back (_X); }
19
27
void pop () { c.pop_back (); }
20
28
bool operator ==(const _Myt& _X) const { return c == _X.c ; }
You can’t perform that action at this time.
0 commit comments