
I have a set of types, that are either native types or array types that have a typedef called value_type, which is a native type. I can get this value_type using the following metafunction: template<typename T> struct get_value_type { typedef typename T::value_type type; }; I was using mpl if_ incorrectly so that instead of creating an object of "value_type", I was creating an object of "get_value_type" like the following; struct MyType { typedef int value_type }; typedef MyType T; typedef mpl::if_<mpl::not<is_pod<T> >,get_value_type<T>,T>::type my_type; my_type t; It can be difficult to understand the difference between if_ and eval_if. If I derive get_value_type from nonconstructible, this would not have compiled. Chris On 7/24/06, Gennaro Prota <gennaro_prota@yahoo.com> wrote:
On Mon, 24 Jul 2006 15:54:33 -0400, "Chris Weed" <chrisweed@gmail.com> wrote:
Recently I was burned by a traits class that was getting constructed.
Out of curiosity, what problem did you have?
-- [ Gennaro Prota, C++ developer for hire ]
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost