Re: gcc linking question
Re: gcc linking question
- Subject: Re: gcc linking question
- From: Steve Checkoway <email@hidden>
- Date: Sat, 3 Nov 2007 11:26:59 -0700
On Nov 3, 2007, at 10:03 AM, mothra wrote:
Excellent. Apple is not a rogue entity, my code is now more
compliant,
*and* I now understand how the compiler was handling my old code.
Thanks
so much for the help!
It might be worth noting this part of the standard (yes, I was too
tired to look at it last night, but not now =), 9.4.2.4
[class.static.data]:
If a static data member is of const integral or const enumeration
type, its declaration in the class definition can specify a constant-
initializer which shall be an integral constant expression within
its scope. The member shall still be defined in a namespace scope if
it is used in the program and the namespace scope definition shall
not contain an initializer.
So in your example, this should be fine:
// Merp.h
class Merp
{
// ...
static const double Thing = 1.0;
};
// Merp.cc
const double Merp::Thing;
That's probably more akin to what you want.
--
Steve Checkoway
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden