考虑这个例子:
template <typename T> inline constexpr bool C1 = true;
template <typename T> inline constexpr bool C2 = true;
template <typename T> requires C1<T> && C2<T>
constexpr int foo() { return 0; }
template <typename T> requires C1<T>
constexpr int foo() { return 1; }
constexpr int bar() {
return foo<int>();
}
Run Code Online (Sandbox Code Playgroud)
调用是foo<int>()不明确的,还是约束C1<T> && C2<T>包含C1<T>?