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);
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
Definition at line 14 of file copy_compare_aggregates.hpp.