by ytugiuyghvk · 9y ago · 0 comments
auto foo(int = 0);
declares a function with a int parameter with default value 0. In this case, it's just a conventional place to stick an expression in the declaration to trigger SFINAE. If you don't need SFINAE, you can also just place the condition in a static_assert in the definition template <class T>
auto foo(T&&) {
static_assert(!is_reference<T>::value, "call me with an r-value");
...
}No comments yet.