From f25a1bec75931f941e73f32f845f02df4572892a Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Sat, 6 Jan 2018 22:05:09 +0500 Subject: [PATCH] Use std::stack for xr_stack There's no difference basically.. --- src/xrCommon/xr_stack.h | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/src/xrCommon/xr_stack.h b/src/xrCommon/xr_stack.h index a17d2aa9a4f..cbe9c344824 100644 --- a/src/xrCommon/xr_stack.h +++ b/src/xrCommon/xr_stack.h @@ -1,39 +1,8 @@ #pragma once +#include #include "xr_vector.h" -//#include -// XXX: Use standard implementation? -//template > -//using xr_stack = std::stack; - -// XXX: Use profiler or something to know if this is faster than std::stack -template > -class xr_stack -{ -public: - using allocator_type = typename _C::allocator_type; - using value_type = typename allocator_type::value_type; - using size_type = typename allocator_type::size_type; - using _Myt = xr_stack<_Ty, _C>; - - allocator_type get_allocator() const { return c.get_allocator(); } - bool empty() const { return c.empty(); } - size_type size() const { return c.size(); } - value_type& top() { return c.back(); } - const value_type& top() const { return c.back(); } - void emplace(value_type&& _X) { c.emplace_back(_X); } - void push(value_type&& _X) { c.push_back(std::move(_X)); } - void push(const value_type& _X) { c.push_back(_X); } - void pop() { c.pop_back(); } - bool operator==(const _Myt& _X) const { return c == _X.c; } - bool operator!=(const _Myt& _X) const { return !(*this == _X); } - bool operator<(const _Myt& _X) const { return c < _X.c; } - bool operator>(const _Myt& _X) const { return _X < *this; } - bool operator<=(const _Myt& _X) const { return !(_X < *this); } - bool operator>=(const _Myt& _X) const { return !(*this < _X); } - -protected: - _C c; -}; +template > +using xr_stack = std::stack; #define DEFINE_STACK(T, N) using N = xr_stack;