Boost logo

Boost Users :

Subject: Re: [Boost-users] [type_traits] defining my own trait
From: Brian Budge (brian.budge_at_[hidden])
Date: 2012-07-20 23:38:14


> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net