Event Dime
C++26: Ordering of constraints involving fold expressions
Events
- When:
- May 26, 2026 · 10:00 PM
- Source:
- The Software Engineer's Guidebook by Orosz Gergely
You have two overloads of g(). One requires A for each element in a pack, the other requires C — where C is a stricter concept that subsumes A. Both apply to the types you’re passing. The compiler should pick the more constrained version. But instead it complains about an ambiguous call. This is a limitation of how C++20 and 23 handle constraints that use fold expressions — f...