
24 Mar
2021
24 Mar
'21
2:53 p.m.
On 3/24/21 5:45 PM, Bjorn Reese via Boost wrote:
You can use C++20 std::type_identity (or roll your own) to prevent the second T from being deduced. In Richard Smith's example:
template<class T, bool (*F)(std::type_identity_t<T>), int> struct X; template<class T, bool (*F)(std::type_identity_t<T>)> struct X<T, F, 0> {}; X<char const, nullptr, 0> x;
As I commented in the clang bug, I don't think you should have to do this. There is only one T this template, and it is explicitly specified at the point of template instantiation, so there's nothing to deduce.