C++ typedef is all we need?

release/4.3a0
dellaert 2018-11-08 16:18:12 -05:00
parent b7f7e147cd
commit 6fef22f1ed
1 changed files with 12 additions and 2 deletions

View File

@ -19,12 +19,20 @@
#pragma once #pragma once
#include <gtsam/base/FastDefaultAllocator.h> #include <gtsam/base/FastDefaultAllocator.h>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/vector.hpp>
#include <vector> #include <vector>
namespace gtsam { namespace gtsam {
#ifndef GTSAM_USE_OLD_FAST_VECTOR
template <typename T>
using FastVector = std::vector<T, typename internal::FastDefaultVectorAllocator<T>::type>;
#else
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/vector.hpp>
/** /**
* FastVector is a thin wrapper around std::vector that uses the boost * FastVector is a thin wrapper around std::vector that uses the boost
* pool_allocator instead of the default STL allocator. This is just a * pool_allocator instead of the default STL allocator. This is just a
@ -91,4 +99,6 @@ class FastVector: public std::vector<VALUE,
ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base); ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
} }
}; };
#endif
} // namespace gtsam } // namespace gtsam