@@ -201,9 +201,12 @@ struct resolver<Q, 0, Ts...> : candidate<Q, 0, std::tuple_element_t<0, std::tupl
201201template <template <typename ...> class , typename , typename , typename = void >
202202struct impl : std::integral_constant<std::size_t , std::numeric_limits<std::size_t >::max()>
203203{};
204- template <template <typename ...> class Q , typename Fun, typename ... Ts>
205- struct impl <Q, Fun, types<Ts...>, void_t <decltype (resolver<Q, sizeof ...(Ts) - 1U , Ts...>::match(std::declval<Fun>()))>>
206- : decltype (resolver<Q, sizeof ...(Ts) - 1U , Ts...>::match(std::declval<Fun>()))
204+ template <template <typename ...> class Q , typename From, typename ... Ts>
205+ struct impl <Q,
206+ From,
207+ types<Ts...>,
208+ void_t <decltype (resolver<Q, sizeof ...(Ts) - 1U , Ts...>::match(std::declval<From>()))>>
209+ : decltype (resolver<Q, sizeof ...(Ts) - 1U , Ts...>::match(std::declval<From>()))
207210{
208211 static_assert (sizeof ...(Ts) > 0 , " tried to match conversion to no types." );
209212};
@@ -222,15 +225,17 @@ struct impl<Q, Fun, types<Ts...>, void_t<decltype(resolver<Q, sizeof...(Ts) - 1U
222225// /
223226// / Hint: to weed out narrowing conversions, use \ref is_convertible_without_narrowing in the predicate.
224227// /
225- // / If no suitable conversion is available, the value is `std::numeric_limits<std::size_t>::max()`.
228+ // / If no suitable conversion is available, or the best conversion is ambiguous,
229+ // / the value is `std::numeric_limits<std::size_t>::max()`.
230+ // / One way to get this error is to choose between `long` and `int` on a platform where they have the same size.
226231// /
227232// / \code
228233// / best_conversion_index_v<universal_predicate, long, float> == 0
229- // / best_conversion_index_v<universal_predicate, float, long, float, double, bool> == 1
234+ // / best_conversion_index_v<universal_predicate, float, long, float, bool> == 1
230235// / best_conversion_index_v<universal_predicate, int, long, float, bool> == ambiguity
231236// /
232- // / best_conversion_index_v<std::is_signed, long, char, long, unsigned long> == 1
233- // / best_conversion_index_v<std::is_unsigned, long, char, long, unsigned long> == 2
237+ // / best_conversion_index_v<std::is_signed, long, unsigned char, long, unsigned long> == 1
238+ // / best_conversion_index_v<std::is_unsigned, long, signed char, long, unsigned long> == 2
234239// / best_conversion_index_v<std::is_volatile, char, int, const int, volatile int> == 2
235240// /
236241// / best_conversion_index_v<partial<is_convertible_without_narrowing, int>::template type, int, float, bool, long> == 2
0 commit comments