template<typename v_src, typename v_dst, int... prp>
struct object_si_d< v_src, v_dst, OBJ_ENCAP, prp...>
It copy the properties from one object to another.
Given a set of properties for the source object (0,1,3) it copy that properties to the destination object properties (0,1,2)
For object we mean an object that follow the OpenFPM data structure format, see openFPM_data wiki for more information
Create a compile-time object and copy from the selected properties
typedef Point_test<float>::type vboost;
typedef object_creator<Point_test<float>::type,0,1,4>::type vboost_red;
object<vboost> src;
object<vboost_red> dst;
boost::fusion::at_c<p::x>(src.data) = 1.0;
boost::fusion::at_c<p::y>(src.data) = 2.0;
for (size_t i = 0 ; i < 3 ; i++)
boost::fusion::at_c<p::v>(src.data)[i] = i + 5.0;
BOOST_REQUIRE_EQUAL(boost::fusion::at_c<0>(dst.data),1.0);
BOOST_REQUIRE_EQUAL(boost::fusion::at_c<1>(dst.data),2.0);
for (size_t i = 0 ; i < 3 ; i++)
BOOST_REQUIRE_EQUAL(boost::fusion::at_c<2>(dst.data)[i],i + 5.0);
Create a compile-time Encap object and copy from the selected properties
typedef encapc<1,Point_test<float>,openfpm::vector<Point_test<float>>::memory_conf> encap_src;
v_point.resize(2);
v_point_red.resize(2);
v_point.template get<p::x>(0) = 1.0;
v_point.template get<p::y>(0) = 2.0;
for (size_t i = 0 ; i < 3 ; i++)
v_point.template get<p::v>(0)[i] = i + 5.0;
auto src_e = v_point.get(0);
auto dst_e = v_point_red.get(0);
BOOST_REQUIRE_EQUAL(v_point_red.get(0).template get<0>(),1.0);
BOOST_REQUIRE_EQUAL(v_point_red.get(0).template get<1>(),2.0);
for (size_t i = 0 ; i < 3 ; i++)
BOOST_REQUIRE_EQUAL(v_point_red.get(0).template get<2>()[i],i + 5.0);
Definition at line 164 of file object_si_d.hpp.