This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: I can not compile code from <<modern c++ design>>
- From: Matthias Oltmanns <Mathias dot Oltmanns dot Oltmanns at sysde dot eads dot net>
- To: Di Yang <diy at qualcomm dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 07 Apr 2003 13:02:01 +0200
- Subject: Re: I can not compile code from <<modern c++ design>>
- References: <5.1.0.14.2.20030407172155.03ff8788@m2.qualcomm.com>
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