This is the mail archive of the gcc-help@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: I can not compile code from <<modern c++ design>>


Am Mon, 2003-04-07 um 11.24 schrieb Di Yang:
> Hi,
> 
> public:
> enum { exists = sizeof(Test(MakeT())) == sizeof(Small) };

Hi,

this seems to be not valid C++ code because the calls to the
static members 'Test' and 'MakeT' are not const expressions at compile
time.
For assignments to enum literals there are only integer expressions
allowed which are evaluated at compile time.

cu
Matthias

-- 
Matthias Oltmanns

Tel: 04421-1543-274
mail: Mathias dot Oltmanns dot Oltmanns at sysde dot eads dot net


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