template<typename T>
struct meta_compare< T >
This class compare general objects.
this function is a general function to compare
- primitives
- array of primitives
- complex objects
- aggregates
Usage of meta copy and compare for primitives
float f_src = 1.0;
float f_dst;
BOOST_REQUIRE_EQUAL(f_src,f_dst);
BOOST_REQUIRE_EQUAL(ret,true);
Usage of meta copy and compare for array of primitives
float f_src[2][3] = {{1.0,2.9,4.0},{2.3,4.4,9.0}};
float f_dst[2][3];
BOOST_REQUIRE_EQUAL(ret,true);
Usage of meta copy and compare for openfpm aggregates
boost::fusion::at_c<0>(agg1.
data) = 1.0;
boost::fusion::at_c<1>(agg1.
data) = 2.0;
boost::fusion::at_c<2>(agg1.
data)[0] = 3.0;
boost::fusion::at_c<2>(agg1.
data)[1] = 4.0;
boost::fusion::at_c<2>(agg1.
data)[2] = 5.0;
BOOST_REQUIRE_EQUAL(ret,true);
aggregate of properties, from a list of object if create a struct that follow the OPENFPM native stru...
Usage of meta copy and compare for complex object
std::string s_src("Test string");
std::string s_dst;
BOOST_REQUIRE_EQUAL(s_src,s_dst);
BOOST_REQUIRE_EQUAL(ret,true);
Usage of meta copy and compare for complex aggregates object
a_src.template get<0>() = std::string("Test string");
a_src.template get<1>().push_back(5.0);
a_src.template get<1>().push_back(15.0);
a_src.template get<1>().push_back(45.0);
a_src.template get<1>().push_back(7.0);
a_src.template get<2>()[0] = std::string("Test string 2");
a_src.template get<2>()[10] = std::string("Test string 3");
a_src.template get<2>()[9] = std::string("Test string 4");
a_src.template get<2>()[1] = std::string("Test string 5");
a_src.template get<3>()[0] = std::string("Last string 9");
a_src.template get<3>()[1] = std::string("Last string 10");
a_src.template get<3>()[2] = std::string("Last string 11");
BOOST_REQUIRE_EQUAL(ret,true);
Usage of meta copy and compare for Point_test
p_src.template get<p::x>() = 1;
p_src.template get<p::y>() = 567;
p_src.template get<p::z>() = 341;
p_src.template get<p::s>() = 5670;
p_src.template get<p::v>()[0] = 921;
p_src.template get<p::v>()[1] = 5675;
p_src.template get<p::v>()[2] = 117;
p_src.template get<p::t>()[0][0] = 1921;
p_src.template get<p::t>()[0][1] = 25675;
p_src.template get<p::t>()[0][2] = 3117;
p_src.template get<p::t>()[1][0] = 4921;
p_src.template get<p::t>()[1][1] = 55675;
p_src.template get<p::t>()[1][2] = 6117;
p_src.template get<p::t>()[2][0] = 7921;
p_src.template get<p::t>()[2][1] = 85675;
p_src.template get<p::t>()[2][2] = 9117;
BOOST_REQUIRE_EQUAL(ret,true);
Test structure used for several test.
Definition at line 37 of file meta_compare.hpp.