r/cpp • u/anonymous23874 • Apr 19 '20
Default function arguments are the devil
https://quuxplusone.github.io/blog/2020/04/18/default-function-arguments-are-the-devil/
90
Upvotes
r/cpp • u/anonymous23874 • Apr 19 '20
View all comments
Show parent comment
3
u/flashmozzg Apr 19 '20
Not exactly? At least as far as I see it you can only ask "if thing of this type is callable with args of these types". Default arguments obviously are not part of the type.
I think with C++20 you can just use
requiresas a way to SFINAE test whether some thing makes sense, i.e. https://godbolt.org/z/wdPrgi