Β§14.10.3 Partial ordering by constraints [temp.constr.order] N4553 indicates that constraint expressions formed from concepts and logical operators should be partially ordered and used to select the best viable function in cases of overload. But is this also applicable to constraint expressions using convolutional expressions of logical operators?
For example, is gcc correct to give an ambiguous overload error here, or is the code really typing "c"?
template <class T> concept bool A = std::is_move_constructible<T>::value;
template <class T> concept bool B = std::is_copy_constructible<T>::value;
template <class T> concept bool C = A<T> && B<T>;
template <class... _tx>
requires (A<_tx> && ...)
void g(_tx... tx) {
std::cout << "a\n";
}
template <class... _tx>
requires (C<_tx> && ...)
void g(_tx... tx) {
std::cout << "c\n";
}
f(3, 2.0)
source
share