GitNexus/gitnexus/test/fixtures/lang-resolution/cpp-sfinae-arity-survives-unknown/main.cpp
Zander Raycraft a4dfebd073
feat(cpp): sfinae filter (#1623)
* feat(cpp): SFINAE-aware overload filter — drops candidates whose enable_if_t / requires constraints fail (#1579)

* fix(cpp):  SFINAE follow-ups for is_integral_v/is_arithmetic_v bool and char support, an unqualified F1 test fixture, and parameter-lookup gap documentation (#1579) -> claude feedback

* revert: reverting all changes to .md files
2026-05-16 20:23:13 +01:00

23 lines
637 B
C++

// Filter ordering: arity gate runs BEFORE constraint filter, so a
// bad-arity candidate is dropped even when its constraint would have
// returned 'unknown' (and thus kept it). Asserts exactly 1 CALLS edge
// to the good overload — guards the filter-step ordering invariant.
#include <type_traits>
template<class T>
constexpr bool MyCustomTrait_v = true;
template<class T, std::enable_if_t<MyCustomTrait_v<T>, int> = 0>
void process(T value) {
(void)value;
}
template<class T, std::enable_if_t<MyCustomTrait_v<T>, int> = 0>
void process(T value, T other) {
(void)value;
(void)other;
}
void run() {
process(42);
}