This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/9048] Conditional expression error with static const members
- From: "hull at paracel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Mar 2004 19:51:52 -0000
- Subject: [Bug c++/9048] Conditional expression error with static const members
- References: <20021223143600.9048.jmc@xisl.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From hull at paracel dot com 2004-03-19 19:51 -------
I now understand why it isn't a bug.
Even though class foo says
class foo {
static const int bar1 = 1, bar2 = 2;
...
};
it is also necessary to write
const int foo::bar1, foo::bar2;
This is what Nathan Sidwell's comment was saying, but I didn't
understand it. This means that "static const int" is not quite
the complete replacement for "#define" that I misunderstood it
to be because it's not a header-only solution.
Thank you for your patience.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9048