C++ typedef is all we need?
parent
b7f7e147cd
commit
6fef22f1ed
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue