Discussion:
B const * array[ ] in gobal
(too old to reply)
Christian Hackl
2010-02-10 12:15:56 UTC
Permalink
This shouldn't compile. I don't see any user defined overload
of D::operator&, so & is the built in operator, which requires
an lvalue.
I understand your explanation but where can I find in the Standard
why this shouldn't compile ?
gcc version 4.0.1 and around 4.4 gave warning but created exe.
Visual C++ 2008 Express gave no warning and error at the
highest warning level.
That's because you must tell VC not to use Microsoft's language
extensions by specifying /Za. With /Za specified, you'll get the
following errors:

vc.cpp(37) : error C2102: '&' requires l-value
vc.cpp(37) : error C2466: cannot allocate an array of constant size 0


x-post & f'up to microsoft.public.vc.language
--
Christian Hackl
***@sbox.tugraz.at

Milano 2008/2009 -- L'Italia chiamò, sì!
soft wind
2010-02-10 13:53:15 UTC
Permalink
Post by Christian Hackl
That's because you must tell VC not to use Microsoft's language
extensions by specifying /Za. With /Za specified, you'll get the
Thank you for your advice.
I will do it.

Tsunehiko
soft wind
2010-02-10 13:53:36 UTC
Permalink
Post by Christian Hackl
That's because you must tell VC not to use Microsoft's language
extensions by specifying /Za. With /Za specified, you'll get the
Thank you for your advice.
I will do it.

Tsunehiko
soft wind
2010-02-11 12:39:49 UTC
Permalink
Post by Christian Hackl
That's because you must tell VC not to use Microsoft's language
extensions by specifying /Za. With /Za specified, you'll get the
Thanks for your advice.
I will do it.

Tsunehiko
soft wind
2010-02-11 12:40:08 UTC
Permalink
Post by Christian Hackl
That's because you must tell VC not to use Microsoft's language
extensions by specifying /Za. With /Za specified, you'll get the
Thanks for your advice.
I will do it.

Tsunehiko
soft wind
2010-02-11 13:48:03 UTC
Permalink
Post by Christian Hackl
That's because you must tell VC not to use Microsoft's language
extensions by specifying /Za. With /Za specified, you'll get the
Thanks for your advice.
I will do it.

Tsunehiko

Loading...