4 #include "blub/core/globals.hpp"
6 #include <boost/container/list.hpp>
13 class list :
public boost::container::list<T>
16 typedef boost::container::list<T> t_base;
18 list<T>() : boost::container::list<T>() {;}
19 list<T>(
const uint32 &num) : boost::container::list<T>() {this->reserve(num);}
20 list<T>(boost::container::list<T> lst) : boost::container::list<T>(lst) {;}
22 T& at(
const uint32& ind)
24 BASSERT(ind < t_base::size());
25 typename t_base::iterator it(t_base::begin());
26 for (uint32 index = 0; index < ind; ++index)
33 const T& at(
const uint32& ind)
const
35 BASSERT(ind < t_base::size());
36 typename t_base::const_iterator it(t_base::cbegin());
37 for (uint32 index = 0; index < ind; ++index)
44 void reserve(uint32 size)
46 if (t_base::size() > size)
48 size = t_base::size();
53 bool isEmpty(
void)
const
55 return t_base::empty();
58 void insertAt(
const uint32& ind,
const T& toInsert)
60 BASSERT(ind < t_base::size());
61 t_base::insert(t_base::cbegin()+ind, toInsert);
64 void removeAt(
const uint32& ind)
66 BASSERT(ind < t_base::size());
67 typename t_base::const_iterator it(t_base::cbegin());
68 for (uint32 index = 0; index < ind; ++index)
75 int32 indexOf(
const T& toFind)
77 typename t_base::const_iterator it(t_base::cbegin());
78 for (uint32 index = 0; index < t_base::size(); ++index)
104 bool push_back_distinct(
const T & ins)
106 if (t_base::indexOf(ins) == -1)
108 t_base::push_back(ins);
118 #endif // BLUB_LIST_HPP
Definition: deadlineTimer.hpp:10