This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++: constant folding in a conditional expr
Andrew Haley wrote:
> So, what would the legal form of this program be? Like this, I guess:
>
> class Foo
> {
> public:
> static const unsigned ACONST = 0;
> static const unsigned BCONST = 1;
>
> void SetData(bool p);
>
> private:
> unsigned _data;
> };
>
> const unsigned Foo::ACONST;
> const unsigned Foo::BCONST;
yes these two are the definitions. And of course, they must obey the one
definition rule. [3.2]
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org