Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2003-01-09 11:09:35


On 09 Jan 2003 15:29:30 +0100, Gabriel Dos Reis
<gdr_at_[hidden]> wrote:

>I'm a long term pro-enum (mostly because for the meta programming
>stuff I had to do, it works very well), but I do understand the
>potential drawbacks raised by the pro-'static const' camp.

Ok. Now for the most stupid question of the year: what would be wrong
if the rule was that the name of a static const data member was an
lvalue if and only if the member is not initialized in-class?

a) struct A {
      static const int n; // n is an lvalue
   };

   const int A::n = 5;

b) struct A {
      static const int n = 5; // here n is an rvalue
   };

Genny.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk