Boost logo

Boost Users :

Subject: [Boost-users] boost::mpl and VS 2005
From: narinder.claire_at_[hidden]
Date: 2011-07-12 07:57:55


The following piece of code compile successfully on VS2008,VS2010 & GCC
4.5.2 but fails to compile on VS2005.
Is the likely to be because of a bug in VS2005 ? (boost v 1.46.1)


template<class T>
struct is_recognised_type
    static const bool value =false;

typedef boost::mpl::vector<std::string> naked_variant_type_list;

struct myclass

    template<class T>
    myclass(const T&t,
            const typename
boost::disable_if_c<is_recognised_type<T>::value,T >::type * ptr =0,
            const typename boost::disable_if_c<
                       typename boost::mpl::filter_view<
>::type>::value>::type * pt =0,
            const typename boost::enable_if_c<
                       typename boost::mpl::filter_view<
>::type>::value>::type * pt2 =0)


int main()
    myclass m;
    m = "hello";


My workaround is to collapse is_convertible and is_base_of into a
single type_trait is_convertible_but_not_derived_from. and then it works.
The problems seems to be that there are two trait checks, using either one
seems to work.


This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is prohibited.

Please refer to for additional disclosures.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at