diff --git a/include/boost/detail/named_template_params.hpp b/include/boost/detail/named_template_params.hpp index a25ddbb..8998854 100644 --- a/include/boost/detail/named_template_params.hpp +++ b/include/boost/detail/named_template_params.hpp @@ -8,6 +8,7 @@ #define BOOST_DETAIL_NAMED_TEMPLATE_PARAMS_HPP #include +#include // for is_reference #if defined(__BORLANDC__) #include #endif @@ -87,9 +88,24 @@ namespace boost { // we use is_convertible. struct named_template_param_base { }; + struct is_convertible_to_named_param { + template struct bind { + enum { value = is_convertible::value }; + }; + }; + struct not_named_param { + template struct bind { + enum { value = false }; + }; + }; + template struct is_named_param_list { - enum { value = is_convertible::value }; + // If X is a reference type, we can't form a pointer and use is_convertible, + // but we know that if it is a reference, it isn't a named parameter. + typedef typename ct_if::value, + not_named_param, is_convertible_to_named_param>::type IsNamedParam; + enum { value = IsNamedParam::template bind::value }; }; struct choose_named_params {