This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14404] static const integral member cannot be passed as const reference
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Mar 2004 09:52:51 -0000
- Subject: [Bug c++/14404] static const integral member cannot be passed as const reference
- References: <20040303090313.14404.saurik@saurik.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pcarlini at suse dot de 2004-03-03 09:52 -------
Not a bug. We are talking about a static member, therefore, in general, you
initialize it outside the class definition:
struct Foo { static const unsigned value; };
const unsigned Foo::value = 1024;
Alternately, for integral types, you can *initialize* within the class body:
struct Foo { static const unsigned value = 1024; };
const unsigned Foo::value;
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14404