add a way to disambiguate template overloads for named parameters

This commit is contained in:
Sébastien Loriot 2022-09-19 06:29:15 +02:00
parent 4701aadf1d
commit c879db0bcd
1 changed files with 9 additions and 0 deletions

View File

@ -20,6 +20,7 @@
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/has_xxx.hpp>
#include <type_traits>
#include <utility>
@ -311,6 +312,9 @@ struct Named_function_parameters
{
return Named_function_parameters<OT, OTag, self>(np.v,*this).combine(nps...);
}
// typedef for SFINAE
typedef int CGAL_Named_function_parameters_class;
};
namespace parameters {
@ -522,4 +526,9 @@ namespace boost
}
#endif
// For disambiguation using SFINAR
BOOST_MPL_HAS_XXX_TRAIT_DEF(CGAL_Named_function_parameters_class)
template<class T>
CGAL_CPP17_INLINE constexpr bool is_named_function_parameter = has_CGAL_Named_function_parameters_class<T>::value;
#endif // CGAL_BOOST_FUNCTION_PARAMS_HPP