conversion between vectors with different allocator types

This commit is contained in:
Christian Zimmermann 2019-03-17 23:56:35 +01:00
parent c277fbde53
commit de8d456f73

View file

@ -68,6 +68,18 @@ namespace MultiArrayTools
{ {
template <typename T> template <typename T>
using vector = std::vector<T,MultiArrayHelper::Allocator<T>>; using vector = std::vector<T,MultiArrayHelper::Allocator<T>>;
template <typename T>
inline std::vector<T> toStdVec(const vector<T>& v)
{
return std::vector<T>(v.begin(), v.end());
}
template <typename T>
inline vector<T> toMatVec(const std::vector<T>& v)
{
return vector<T>(v.begin(), v.end());
}
} // namespace MultiArrayTools } // namespace MultiArrayTools