#ifndef LIST_H #define LIST_H #include #include #include //! List class with extended functionality over std::vector. template > class List : public B { public: //! Default constructor. List() : B() {} //! Iterator constructor. template List(InputIterator first, InputIterator last) : B(first, last) {} //! Sort the list. void sort() { std::sort(B::begin(), B::end()); } //! Check if specified item is present in list. bool contains(T item) { return std::find(B::begin(), B::end(), item) != B::end(); } //! Delete item by index. void del(std::size_t index) { erase(B::begin() + index); } //! Check whether list is empty or not. operator bool() const { return !B::empty(); } //! Allow serialization through Boost.Serialize. template void serialize(Archive & ar, const unsigned int version) { ar & boost::serialization::base_object(*this); } }; #endif