21 Jul
2012
21 Jul
'12
3:38 a.m.
As Steven said, no, but one thing that may minimize the boilerplate is for the default implementation to detect whether a specific typedef is present (e.g., is_memcpyable_tag), and, if so, use T::is_memcpyable_tag::value for the value of is_memcpyable<T>::value. Then write a macro that typedef's is_memcpyable_tag given a set of base and member objects, which makes your class definitions something like
struct foo : public Eigen::Vector3f { TYPEDEF_IS_MEMCPYABLE_TAG( ( Eigen::Vector3f ) ) };
struct bar { TYPEDEF_IS_MEMCPYABLE_TAG( ( Eigen::Vector3f ) ( X ) )
Eigen::Vector3f m_vec; X some_member; };
This is something maybe to consider, anyway.
- Jeff
Okay, thanks for the suggestion Jeff. I'll look into it. Brian