[Bug c++/66834] [concepts] concept parameter kind mismatch causes hard error
Casey at Carter dot net
gcc-bugzilla@gcc.gnu.org
Sat Jul 11 17:38:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66834
--- Comment #4 from Casey Carter <Casey at Carter dot net> ---
I conjecture that Constructible<T, U>() is ambiguous, since both templates will
specialize for it. I was thinking:
template <class T>
concept bool Constructible() {
return requires {
T{};
};
}
template <class T, class U>
concept bool Constructible() {
return ExplicitlyConvertible<U, T>() ||
requires (U&& u) {
T{ (U&&)(u) };
};
}
template <class T, class First, class Second, class... Rest>
concept bool Constructible() {
return requires (First&& first, Second&& second, Rest&&... rest) {
T{ (First&&)first, (Second&&)second, (Rest&&)(rest)... };
};
}
which has no such ambiguities of specialization. (This is getting a little
off-topic for this bug report - we should takes this offline.)
More information about the Gcc-bugs
mailing list