suppose we have an object with the following interface:
struct Node_t {
... const std::vector< something >& getChilds() const;
} node;
The type of childs
will be std::vector
.
auto
is powered by the same rules as template type deduction. The type picked here is the same that would get picked for template
in a call like f(node->getChilds())
.
Similarly, auto&
would get you the same type that would get picked by template
, and auto&&
would get you the same type that would get picked by template
.
The same applies for all other combinations, like auto const&
or auto*
.