diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 6db0823a2..a23e1489b 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -165,40 +165,30 @@ namespace tinystl class list : public vector { public: - void push_front(const T& _value); - void pop_front(); + void push_front(const T& _value) + { + this->insert(this->begin(), _value); + } - void sort(); + void pop_front() + { + this->erase(this->begin() ); + } - private: - vector m_vector; + void sort() + { + bx::quickSort( + this->begin() + , uint32_t(this->end() - this->begin() ) + , sizeof(T) + , [](const void* _a, const void* _b) -> int32_t { + const T& lhs = *(const T*)(_a); + const T& rhs = *(const T*)(_b); + return lhs < rhs ? -1 : 1; + }); + } }; - template - inline void list::push_front(const T& _value) - { - this->insert(this->begin(), _value); - } - - template - inline void list::pop_front() - { - this->erase(this->begin() ); - } - - template - inline void list::sort() - { - bx::quickSort( - this->begin() - , uint32_t(this->end() - this->begin() ) - , sizeof(T) - , [](const void* _a, const void* _b) -> int32_t { - const T& lhs = *(const T*)(_a); - const T& rhs = *(const T*)(_b); - return lhs < rhs; - }); - } } // namespace tinystl namespace stl = tinystl;