Tuesday, 10 September 2013

What are the pros and cons of each way to initialize a variable with an expression?

What are the pros and cons of each way to initialize a variable with an
expression?

This is inspired from a post from Andrei Alexandrescu.
What are the pro's and con's of initializing an expression with the
following methods? When should I prefer one over the other?
auto v = expr;
T v = expr;
auto v(expr);
T v(expr);
auto v { expr };

No comments:

Post a Comment