Top "Auto" questions

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

Is there a downside to declaring variables with auto in C++?

It seems that auto was a fairly significant feature to be added in C++11 that seems to follow a lot …

c++ c++11 type-inference auto
Using 'auto' type deduction - how to find out what type the compiler deduced?

How can I find out what type the compiler deduced when using the auto keyword? Example 1: Simpler auto tickTime = 0.001; Was …

c++ c++11 auto chrono
What does auto&& do?

This is the code from C++11 Notes Sample by Scott Meyers, int x; auto&& a1 = x; // x is …

c++ c++11 auto
auto from const std::vector<>&; object or reference?

suppose we have an object with the following interface: struct Node_t { ... const std::vector< something >& getChilds() …

c++ c++11 auto
C++11 auto declaration with and without pointer declarator

What's the difference between the types of bar1 and bar2? int foo = 10; auto bar1 = &foo; auto *bar2 = &foo; …

c++ c++11 auto variable-declaration
Lambda returning itself: is this legal?

Consider this fairly useless program: #include <iostream> int main(int argc, char* argv[]) { int a = 5; auto it = [&](…

c++ lambda language-lawyer c++17 auto
Why do I need to explicitly write the 'auto' keyword?

I am moving towards C++11 from C++98 and have become familiar with the auto keyword. I was wondering why we …

c++ c++11 auto
Recursive call in lambda (C++11)

Possible Duplicate: Recursive lambda functions in c++0x Why can't I call a lambda recursively if I write it as: …

c++ lambda c++11 type-inference auto
What does the auto c++ keyword do?

I recently came accross the keyword auto in c++. In the code: auto maxIterator = std::max_element(&spec[0], &…

c++ auto fmod
Function Templates vs. Auto Keyword

Can the auto keyword in C++11 replace function templates and specializations? If yes, what are the advantages of using template …

c++ templates auto