I know that meaning of auto
keyword has been changed completely from C++11. But Recently I wrote a following simple program that compiles & runs fine when compiling with =std=c++98
option.
#include <iostream>
void fun(auto int a)
{
a=3;
std::cout<<a<<'\n';
}
int main()
{
fun(3);
}
Orwell Dev C++ IDE gives me warning like following:
[Warning] 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat]
So, is it fine to use auto
for function parameters or should I never use auto
like this as in above program to maintain compatibility with C++11?