I found a rather strange behavior from my point of view: the function arguments by default cannot be redirected in the code below.
void Test(int test = int{}) {} template<typename F, typename ...Args> void Foo(F&& f, Args&&... args) { std::forward<F>(f)(std::forward<Args>(args)...); } int main() { Foo(Test, 0);
Clang reports: error: too few arguments to call the function, expected 1, there are 0 GCC and VC report the same errors.
Can someone explain this?
The code is here: http://rextester.com/live/JOCY22484
c ++ c ++ 11 perfect-forwarding
Viktor
source share