What's the status of abbreviated functions in C++? Searching around, I see some mention of it in a working draft on C++ concepts. At the same time, GCC seems to have no problems with code like
#include <iostream>
auto foo(auto x) {
std::cout << x << std::endl;
}
int main() {
foo(1);
foo(1.2);
}
Now, if I do compile with -Wpedantic
, I get the warning:
g++ -std=c++14 -Wpedantic test08.cpp -o test08
test08.cpp:3:9: warning: ISO C++ forbids use of 'auto' in parameter declaration [-Wpedantic]
auto foo(auto x) {
^
which tells me that abbreviate functions are not fully in the standard. As such, what's their current status with respect to the C++ standard and with respect to common C++ compilers?