Quote:Original post by Jonus
Quote:Original post by Fruny
Constants don't take up any memory. Even if they did, that's just 6 ints... nothing to lose sleep over.
Declaring them static, when you've put them in a header file, is completely pointless.
Well but doing so will allow me to complile this stuff in VC++2003. Without the statics it won't.
Why do you think it's pointless?
The first reason being is using the keyword static to make an internal linkage is deprecated in C++, that pre-dates C++ standardization, if you want to do that then would use
anonymous namespaces.
Secondly and i think what Fruny is trying to get at making an internal linkage in headers makes every translation unit have its own version but because they are
real constants (because they are defined in the header) it makes no difference.
Yes you have two kinds of constants, real ones, and logically constant, former consumes no storage while the latter does but is read-only. And it all depends on the context which will be which.
Quote:Original post by Jonus
Using the keyword external in a namespace feels somehow weird to me.
Get use to it [wink], perhaps you should understand what exactly extern does.