What are some uses of decltype(auto)?

In c++14 the decltype(auto) idiom is introduced. Typically its use is to allow auto declarations to use the decltype rules on the given expression. Searching for examples of “good” usage of the idiom I can only think of things like the following (by Scott Meyers), namely for a function’s return type deduction: template<typename ContainerType, typename … Read more

How much is too much with C++11 auto keyword?

I’ve been using the new auto keyword available in the C++11 standard for complicated templated types which is what I believe it was designed for. But I’m also using it for things like: auto foo = std::make_shared<Foo>(); And more skeptically for: auto foo = bla(); // where bla() return a shared_ptr<Foo> I haven’t seen much … Read more