#include
template
concept floating_point = std::is_floating_point_v;
template
concept integral = std::is_integral_v;
template
concept arithmetic = floating_point || integral;
// ------------------------------------
template
constexpr int f() {
return 1;
}
template
constexpr int f() {
return 2;
}
// ------------------------------------
template
requires(arithmetic && ...)
constexpr int g() {
return 1;
}
template
requires(floating_point && ...)
constexpr int g() {
return 2;
}
// ------------------------------------
template
concept all_arithmetic = (arithmetic && ...);
template
concept all_floating_point = (floating_point && ...);
template
requires all_arithmetic
constexpr int h() {
return 1;
}
template
requires all_floating_point
constexpr int h() {
return 2;
}
// ------------------------------------
static_assert(f() == 1); // ok
static_assert(f() == 2); // ok
static_assert(g() == 1); // ok
static_assert(g() == 2); // ok
static_assert(h() == 1); // ok
static_assert(h() == 2); // error (why is this not resolved even after p2963?)
int main() {}
< /code>
Fehler: < /p>
:67:15: error: call to 'h' is ambiguous
67 | static_assert(h() == 2); // error (why is this not resolved even after p2963?)
| ^~~~~~~~~
https://godbolt.org/z/jnye1jqqm
Wenn ich aktuelle Entwurf und p2963r3 richtig gelesen habe Pack sind äquivalent und arithmetische Subsumes floating_point .>
template requires all_arithmetic constexpr int h() { return 1; }
template requires all_floating_point constexpr int h() { return 2; }
// ------------------------------------
static_assert(f() == 1); // ok static_assert(f() == 2); // ok
static_assert(g() == 1); // ok static_assert(g() == 2); // ok
static_assert(h() == 1); // ok static_assert(h() == 2); // error (why is this not resolved even after p2963?)
int main() {} < /code> Fehler: < /p> :67:15: error: call to 'h' is ambiguous 67 | static_assert(h() == 2); // error (why is this not resolved even after p2963?) | ^~~~~~~~~ [/code] https://godbolt.org/z/jnye1jqqm Wenn ich aktuelle Entwurf und p2963r3 richtig gelesen habe Pack sind äquivalent und arithmetische Subsumes floating_point .>
Ich arbeite an einer Kernbankenlösung. Ich habe zwei Microservices, die als Account-CMD-Service und Kundenservice bezeichnet werden. Ich habe versucht, einen Kunden per ID aus dem Kunden-Service zu...
Ich habe ein Problem, während ich den Befehl 'Pod install' in Flutter-Projekten ausführt. Analyzing dependencies
CDN: trunk Repo update failed - 9 error(s):
CDN: trunk URL couldn't be downloaded:...
Ich habe ein abp-Framework und eine mehrinstanzenfähige Openiddict-Anwendung mit der asp.net-Kernbenutzeroberfläche. Ein Mieter kann sich registrieren und ich kann den Mieter und den zugehörigen...
Ich habe meine Android-App im Play Store veröffentlicht, sie funktioniert einwandfrei und steht zum Download bereit. Kürzlich habe ich der App automatische Unterstützung hinzugefügt, aber der Play...