What is the rationale of
(8) The validity of a template may be checked prior to any instantiation. [ Note: Knowing which names are type names allows the syntax of every template to be checked in this way. — end note ] The program is ill-formed, no diagnostic required, if:
[..]
(8.3) every valid specialization of a variadic template requires an empty template parameter pack, or
That rule disallows trick as following to force template deduction as:
template <typename ...Ts,
typename A,
typename B,
std::enable_if_t<sizeof...(Ts) == 0, int> = 0> // Ill-formed NDR :-(
Pair<std::decay_t<A>, std::decay_t<B>> MakePair(A&&a, B&& b)
{
return {a, b};
}
Note: I know that C++17 deduction rule makes make_*
obsolete.