by cheez · 10y ago · 0 comments
auto ptr = make_shared<T>()
Reads very nicely so I agree that if the type should be somewhere in the auto expression. That is, use auto to remove redundancy. I just wish they would have extended type deduction to lambda arguments so I could do: [](a,b){ ... }
Instead of: [](int a, int b) {...}
My understanding is that they're allowing: [](auto a, auto b) {...}
Bleh.Explicit casting if often required to make sure subtle bugs won't show up in production.