Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class xr_vector : public std::vector<T,allocator> {
- private:
- typedef std::vector<T,allocator> inherited;
- public:
- typedef allocator allocator_type;
- public:
- xr_vector () : inherited () {}
- xr_vector (size_t _count, const T& _value) : inherited (_count,_value) {}
- explicit xr_vector (size_t _count) : inherited (_count) {}
- u32 size () const { return (u32)inherited::size();}
- void clear_and_free () { inherited::clear(); }
- void clear_not_free () { erase(begin(),end()); }
- void clear_and_reserve () { if ( capacity() <= (size()+size()/4) ) clear_not_free(); else { u32 old=size(); clear_and_free(); reserve(old); } }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement