Skip to content

C++14 Programming

bellbind edited this page Nov 1, 2015 · 1 revision

Initializer

Initialize variable with C-like initializer syntax instead of constructor call

auto i = std::size_t{0};
std::vector<int> array{{1,2,3}};

lambda style function definition syntax

auto Func(Arg arg) -> void {
    ...
}

decltype(auto)

Type placeholder auto unifies T and T&, const T and T, as T. For keep &, const, and ..., use decltype(auto) instead of auto.