Skip to content
Snippets Groups Projects
Commit 1ad9b3aa authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[la.container.vector-interface] add conversion to std::vector

parent 06426428
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@
#include <limits>
#include <iostream>
#include <type_traits>
#include <vector>
#include <boost/numeric/conversion/cast.hpp>
......@@ -597,6 +598,14 @@ public:
return const_iterator(*this, true);
}
operator std::vector<ScalarType>() const
{
std::vector<ScalarType> ret(dim());
for (size_t ii = 0; ii < dim(); ++ii)
ret[ii] = this->operator[](ii);
return ret;
}
private:
template <class T, class S>
friend std::ostream& operator<<(std::ostream& /*out*/, const VectorInterface<T, S>& /*vector*/);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment