On Tue, Nov 30, 2010 at 9:17 AM, Miles Bader <[email protected]> wrote:
> On Tue, Nov 30, 2010 at 5:13 PM, Gabriel Dos Reis
> <[email protected]> wrote:
>> If you are doing that, why don't you write a simpler code by
>> just defining (e.g. initializing) the data member outside the class?
>
> 'cause I want the compiler to be able to use (inline) the underlying values.
I think it'll do that with initializing the member outside of the class as well.
struct X { static float const v; };
const float X::v = 1;
int main()
{
return (int)X::v;
}
at least works for me (even when not optimizing - huh).
Richard.
> -Miles
>
> --
> Cat is power. Cat is peace.
>