r/cpp • • Mar 27 '26

C++26: A User-Friendly assert() macro

https://www.sandordargo.com/blog/2026/03/25/cpp26-user-friendly-assert
50 Upvotes

27 comments sorted by

View all comments

Show parent comment

1

u/holyblackcat Mar 27 '26

Type constraints do in fact completely replace SFINAE. Everything you could do with SFINAE you can do with type constraints and get the exact same results.

Older Clang versions used to check constraints too late, later than the regular SFINAE, which caused issues like this one: https://gcc.godbolt.org/z/44cE57feb

I'm not sure what the spec has to say about it, but newer versions don't do this anymore.