This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: static const double pi = 3.1415;


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 at codesourcery dot com : http://www.cs.bris.ac.uk/~nathan/ : nathan at acm dot org



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]