gcc 4.9 allows the following code, but gcc 4.8 and clang 3.5.0 reject it.
void foo(auto c) { std::cout << c.c_str(); }
I get warning: ISO C++ forbids use of 'auto' in parameter declaration [-Wpedantic]
in 4.9 but in 4.8 and clang I get error: parameter declared 'auto'
.
Yes, this is an extension. It's likely to be added to C++17 as part of the 'concepts' proposal, I believe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With