implemented specialization of data types via type traits and handling of embedded non-trivial types

This commit is contained in:
2023-12-10 22:40:01 +01:00
parent da423ea8bb
commit 8ad13076c8
17 changed files with 346 additions and 90 deletions
+26
View File
@@ -0,0 +1,26 @@
#ifndef QUERY_COORDINATE_HPP
#define QUERY_COORDINATE_HPP
#include "matador/utils/access.hpp"
namespace matador::test {
struct coordinate
{
int x;
int y;
int z;
};
}
namespace matador::utils::access {
template<class Operator>
void attribute(Operator &op, const char *id, test::coordinate &value, const field_attributes &attr = null_attributes) {
attribute(op, (std::string(id) + "_x").c_str(), value.x, attr);
attribute(op, (std::string(id) + "_y").c_str(), value.y, attr);
attribute(op, (std::string(id) + "_z").c_str(), value.z, attr);
}
}
#endif //QUERY_COORDINATE_HPP