@@ -5,10 +5,10 @@ template <typename _Ty, class _C = xr_vector<_Ty>>
55class xr_stack
66{
77public:
8- typedef typename _C::allocator_type allocator_type;
9- typedef typename allocator_type::value_type value_type;
10- typedef typename allocator_type::size_type size_type;
11- typedef xr_stack<_Ty, _C> _Myt ;
8+ using allocator_type = typename _C::allocator_type;
9+ using value_type = typename allocator_type::value_type;
10+ using size_type = typename allocator_type::size_type;
11+ using _Myt = xr_stack<_Ty, _C>;
1212
1313 allocator_type get_allocator () const { return c.get_allocator (); }
1414 bool empty () const { return c.empty (); }
@@ -17,15 +17,15 @@ class xr_stack
1717 const value_type& top () const { return c.back (); }
1818 void push (const value_type& _X) { c.push_back (_X); }
1919 void pop () { c.pop_back (); }
20- bool operator ==(const _Myt& _X) const { return c== _X.c ; }
21- bool operator !=(const _Myt& _X) const { return !(*this == _X); }
22- bool operator <(const _Myt& _X) const { return c< _X.c ; }
23- bool operator >(const _Myt& _X) const { return _X< *this ; }
24- bool operator <=(const _Myt& _X) const { return !(_X< *this ); }
25- bool operator >=(const _Myt& _X) const { return !(*this < _X); }
20+ bool operator ==(const _Myt& _X) const { return c == _X.c ; }
21+ bool operator !=(const _Myt& _X) const { return !(*this == _X); }
22+ bool operator <(const _Myt& _X) const { return c < _X.c ; }
23+ bool operator >(const _Myt& _X) const { return _X < *this ; }
24+ bool operator <=(const _Myt& _X) const { return !(_X < *this ); }
25+ bool operator >=(const _Myt& _X) const { return !(*this < _X); }
2626
2727protected:
2828 _C c;
2929};
3030
31- #define DEFINE_STACK (T, N ) typedef xr_stack<T> N ;
31+ #define DEFINE_STACK (T, N ) using N = xr_stack<T>;
0 commit comments