mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Cleanup.
This commit is contained in:
50
src/bgfx_p.h
50
src/bgfx_p.h
@@ -165,40 +165,30 @@ namespace tinystl
|
||||
class list : public vector<T, Alloc>
|
||||
{
|
||||
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<T, Alloc> 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<typename T, typename Alloc>
|
||||
inline void list<T, Alloc>::push_front(const T& _value)
|
||||
{
|
||||
this->insert(this->begin(), _value);
|
||||
}
|
||||
|
||||
template<typename T, typename Alloc>
|
||||
inline void list<T, Alloc>::pop_front()
|
||||
{
|
||||
this->erase(this->begin() );
|
||||
}
|
||||
|
||||
template<typename T, typename Alloc>
|
||||
inline void list<T, Alloc>::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;
|
||||
|
||||
Reference in New Issue
Block a user