auto and trailing return types arrive; using aliases replace typedef. The AAA (almost-always-auto) debate starts immediately.
using Callback = std::function<void(Event)>;
auto it = table.find(key); // nobody misses the iterator type
auto policy, CTAD, structured bindings, placeholders.
auto and trailing return types arrive; using aliases replace typedef. The AAA (almost-always-auto) debate starts immediately.
using Callback = std::function<void(Event)>;
auto it = table.find(key); // nobody misses the iterator type
Return-type deduction and decltype(auto) complete the deduction toolkit; variable templates declare families of constants.
template <class T> constexpr T pi = T(3.141592653589793L);
decltype(auto) get() { return (value_); } // preserves reference-ness
Structured bindings and if/switch initializers reshape local declarations: scope-limited, named decomposition at the point of use.
if (auto [it, inserted] = set.insert(x); inserted)
on_new(*it);
Constrained auto everywhere: std::integral auto n = f();, abbreviated function templates (void f(auto x)) — deduction with requirements attached.
auto(x) spells decay-copy; attributes allowed on lambdas; the deduction toolkit is considered complete.
Structured bindings grow up: usable as conditions, can introduce packs (auto [x, ...rest] = tup;), and _ becomes a real placeholder that never collides.
auto [ok, _] = try_emplace(k, v); // _ : explicitly discarded (C++26)
auto [head, ...tail] = tuple; // binding pack
Stable; nothing adopted or near-term that changes declaration guidance.
C++26 per the final working draft; C++29 rows are proposals and direction, not adopted features.