22 #include <boost/serialization/nvp.hpp>
23 #include <boost/serialization/vector.hpp>
37 template<
typename VALUE>
38 class FastVector:
public std::vector<VALUE, typename internal::FastDefaultVectorAllocator<VALUE>::type> {
42 typedef std::vector<VALUE, typename internal::FastDefaultVectorAllocator<VALUE>::type> Base;
51 explicit FastVector(
size_t size,
const VALUE& initial) : Base(size, initial) {}
54 template<
typename INPUTITERATOR>
55 explicit FastVector(INPUTITERATOR first, INPUTITERATOR last) {
60 Base::assign(first, last);
66 Base::assign(x.begin(), x.end());
72 Base::assign(x.begin(), x.end());
79 template<
typename ALLOCATOR>
86 Base::assign(x.begin(), x.end());
90 operator std::vector<VALUE>()
const {
91 return std::vector<VALUE>(this->begin(), this->end());
96 friend class boost::serialization::access;
97 template<
class ARCHIVE>
98 void serialize(ARCHIVE & ar,
const unsigned int version) {
99 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
FastVector(const FastSet< VALUE > &x)
Copy constructor from a FastSet.
Definition: FastVector.h:70
FastVector(const std::vector< VALUE, ALLOCATOR > &x)
Copy constructor from a standard STL container.
Definition: FastVector.h:80
A thin wrapper around std::set that uses boost's fast_pool_allocator.
A thin wrapper around std::list that uses boost's fast_pool_allocator.
FastVector(const Base &x)
Copy constructor from the base class.
Definition: FastVector.h:76
FastVector()
Default constructor.
Definition: FastVector.h:45
FastVector(size_t size, const VALUE &initial)
Constructor from size and initial values.
Definition: FastVector.h:51
FastVector(size_t size)
Constructor from size.
Definition: FastVector.h:48
FastVector(INPUTITERATOR first, INPUTITERATOR last)
Constructor from a range, passes through to base class.
Definition: FastVector.h:55
Definition: FastList.h:38
FastVector(const FastList< VALUE > &x)
Copy constructor from a FastList.
Definition: FastVector.h:64
Definition: FastVector.h:38