J
jason.cipriani
I am reading the description of "generalized constant expressions" in C
++0x here:
http://en.wikipedia.org/wiki/C++0x#Generalized_constant_expressions
And I don't understand the purpose of constexpr.
How are these different?
constexpr int Number = 5;
const int Number = 5;
And when would you ever want to do this:
constexpr int Number () { return 5; }
double array[Number()];
Instead of just:
const int Number = 5;
double array[Number];
Thanks,
Jason
++0x here:
http://en.wikipedia.org/wiki/C++0x#Generalized_constant_expressions
And I don't understand the purpose of constexpr.
How are these different?
constexpr int Number = 5;
const int Number = 5;
And when would you ever want to do this:
constexpr int Number () { return 5; }
double array[Number()];
Instead of just:
const int Number = 5;
double array[Number];
Thanks,
Jason