#include <array>struct blah { }; template<typename... Args>constexpr auto foo(Args&&... args){ return std::array<blah, sizeof...(Args)>{{ blah{args}... }};} int main(){ auto res = foo({}, {}); return 0;}
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:12:23: error: too many arguments to function ‘constexpr auto foo(Args&& ...) [with Args = {}]’ auto res = foo({}, {}); ^ prog.cpp:5:16: note: declared here constexpr auto foo(Args&&... args) ^~~
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!