static const double pi = 3.1415;

Nathan Sidwell nathan@codesourcery.com
Wed Feb 19 17:44:00 GMT 2003


Nathan Sidwell wrote:
> We were talking about static *member* constants, not plain static
> constants. The latter are well formed (they do not have to be initialized
> by a constant expression).
bzzt!
they have to be constant expressions in C, but the constraints are more
relaxed and may be evaluated at runtime (C99 [6.7.8]/4 and [6.6]/2,3,4)

In C++ they can be arbitrary expressions (C++ [8.5]/2)

nathan
-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
          The voices in my head said this was stupid too
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org




More information about the Gcc mailing list