Most examples of auto
use the =
operator.
#include <iostream>
int main()
{
auto a = 1;
std::cout << a << '\n';
}
Why don't they use the uniform initializer like this?
#include <iostream>
int main()
{
auto a {1};
std::cout << a << '\n';
}
Is there any advantage or disadvantage of using one syntax over another while using the auto
keyword?