Commit a7d96ef1 authored by Dominik Charousset's avatar Dominik Charousset

Port to new inspect API

parent eb36d19c
...@@ -68,9 +68,9 @@ public: ...@@ -68,9 +68,9 @@ public:
static constexpr size_t num_elements = Size * Size; static constexpr size_t num_elements = Size * Size;
// allows serialization // allows serialization
template <class IO> template <class Inspector>
friend void serialize(IO& in_or_out, square_matrix& m, const unsigned int) { friend error inspect(Inspector& f, square_matrix& m) {
in_or_out & m.data_; return f(meta::type_name("square_matrix"), m.data_);
} }
square_matrix(square_matrix&&) = default; square_matrix(square_matrix&&) = default;
...@@ -116,9 +116,8 @@ string to_string(const square_matrix<Size>& m) { ...@@ -116,9 +116,8 @@ string to_string(const square_matrix<Size>& m) {
ostringstream oss; ostringstream oss;
oss.fill(' '); oss.fill(' ');
for (size_t row = 0; row < Size; ++row) { for (size_t row = 0; row < Size; ++row) {
for (size_t column = 0; column < Size; ++column) { for (size_t column = 0; column < Size; ++column)
oss << fixed << setprecision(2) << setw(9) << m(column, row); oss << fixed << setprecision(2) << setw(9) << m(column, row);
}
oss << '\n'; oss << '\n';
} }
return oss.str(); return oss.str();
......
...@@ -113,10 +113,9 @@ public: ...@@ -113,10 +113,9 @@ public:
using value_type = ivec::value_type; using value_type = ivec::value_type;
static constexpr size_t num_elements = Size * Size; static constexpr size_t num_elements = Size * Size;
// allows serialization template <class Inspector>
template <class IO> friend error inspect(Inspector& f, square_matrix& x) {
friend void serialize(IO& in_or_out, square_matrix& m, const unsigned int) { return f(meta::type_name("square_matrix"), x.data_);
in_or_out & m.data_;
} }
square_matrix(square_matrix&&) = default; square_matrix(square_matrix&&) = default;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment