On 3/24/2021 4:41 AM, Daniela Engert via Boost wrote:
Am 23.03.2021 um 21:13 schrieb Edward Diener via Boost:
I apologize for this non-Boost related post, but I ran into what I thought was a C++17 bug in clang ( also in vc++14.2 C++17 )...
In a template of form
template
whatever up until C++14, the function argument type in the non-type template parameter was never looked at in the deduction of type T because NTTPs weren't deemed dependent on placeholder types in their function arguments. Beginning with C++17, they are. Therefore you may get conflicting type deduction because the second, additional deduction path from the function argument type in the NTTP will never deduce a top-level cv-qualified T in case of non-reference-like arguments. But the first, formerly only deduction path, may. And therein lies the conflict in your example where T = const char in the first path and T = char is in the second.
Well, at least this is my understanding of P0172.
I appreciate your explanation, and the following is not directed at you
personally:
What is there to deduce ? If I specify whatever