Top "Auto" questions

The `auto` keyword was repurposed in C++11 for a deduced type.

How to declare array with auto

I have been playing with auto and I noticed that for most cases you can replace a variable definition with …

c++ c++11 auto
Advantages of auto in template parameters in C++17

What are the advantages of auto in template parameters that will (possibly) be introduced with C++17? Is it just a …

c++ templates auto c++17
C++11 - declaring non-static data members as 'auto'

Does C++11 allow declaring non-static data members as 'auto' if they are initialized in the declaration? For example: struct S { …

c++ c++11 auto variable-declaration
Using auto in loops c++

I get warning signed/unsigned mismatch for the following code: auto n = a.size(); for (auto i = 0; i < n; …

c++ loops c++11 auto
How to use lambda auto parameters in C++11

I have a code in C++14. However, when I used it in C++11, it has an error at const auto. …

c++ c++11 auto
Can the use of C++11's 'auto' improve performance?

I can see why the auto type in C++11 improves correctness and maintainability. I've read that it can also improve …

c++ performance c++11 auto
'auto' not allowed in function prototype with Clang

Using Clang 3.5, 3.6, or 3.7, with the flag std=c++1y the following code does not compile : #include <iostream> auto …

c++ auto c++14 clang++
Is 'auto const' and 'const auto' the same?

Is there a semantic difference between auto const and const auto, or do they mean the same thing?

c++ c++11 language-lawyer constants auto
Differences between C# "var" and C++ "auto"

I'm learning C++ now because I need to write some low level programs. When I learned about "auto" keyword, it …

c# c++ var auto
Use of 'auto func(int)' before deduction of 'auto' in C++14

I have compiled following program in GCC using C++14. #include <iostream> using namespace std; auto func(int i); …

c++ function gcc c++14 auto