23#include <boost/utility/enable_if.hpp>
24#include <boost/serialization/nvp.hpp>
25#include <boost/serialization/version.hpp>
26#include <boost/serialization/optional.hpp>
27#include <boost/serialization/list.hpp>
39template<
typename VALUE>
40class FastList:
public std::list<VALUE, typename internal::FastDefaultAllocator<VALUE>::type> {
44 typedef std::list<VALUE, typename internal::FastDefaultAllocator<VALUE>::type> Base;
50 template<
typename INPUTITERATOR>
51 explicit FastList(INPUTITERATOR first, INPUTITERATOR last) : Base(first, last) {}
60 FastList(std::initializer_list<VALUE> l) : Base(l) {}
62#ifdef GTSAM_ALLOCATOR_BOOSTPOOL
64 FastList(
const std::list<VALUE>& x) {
69 Base::assign(x.begin(), x.end());
74 operator std::list<VALUE>()
const {
75 return std::list<VALUE>(this->begin(), this->end());
81 template<
class ARCHIVE>
82 void serialize(ARCHIVE & ar,
const unsigned int ) {
83 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
An easy way to control which allocator is used for Fast* collections.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
FastList is a thin wrapper around std::list that uses the boost fast_pool_allocator instead of the de...
Definition FastList.h:40
FastList(INPUTITERATOR first, INPUTITERATOR last)
Constructor from a range, passes through to base class.
Definition FastList.h:51
FastList()
Default constructor.
Definition FastList.h:47
FastList(std::initializer_list< VALUE > l)
Construct from c++11 initializer list:
Definition FastList.h:60
FastList(const FastList< VALUE > &x)
Copy constructor from another FastList.
Definition FastList.h:54
friend class boost::serialization::access
Serialization function.
Definition FastList.h:80
FastList(const Base &x)
Copy constructor from the base list class.
Definition FastList.h:57