public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Phil Edwards <phil@jaj.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c++/6945: A static constant that is initialize inline is not create if only a temperary is used Date: Fri, 07 Jun 2002 14:56:00 -0000 [thread overview] Message-ID: <20020607215602.22060.qmail@sources.redhat.com> (raw) The following reply was made to PR c++/6945; it has been noted by GNATS. From: Phil Edwards <phil@jaj.com> To: spamjunk <spamjunk@stny.rr.com> Cc: lerdsuwa@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/6945: A static constant that is initialize inline is not create if only a temperary is used Date: Fri, 7 Jun 2002 17:52:53 -0400 On Fri, Jun 07, 2002 at 05:27:50PM -0400, spamjunk wrote: > Not true. You can't do that when its initialized inline in the class, the > compiler will tell its that its defined twice. Incorrect; writing class Foo { static const int foo = 42; }; only provides a handy way of keeping the '42' in the header file. It does not provide a definition, only a declaration. Writing the above only means that in the ".cc" file, you can write const int Foo::foo; instead of const int Foo::foo = 42; You should either find more textbooks on C++, or buy a copy of the standard. (At $18 for a PDF it's pretty cheap, although the reading is dry.) Phil -- If ye love wealth greater than liberty, the tranquility of servitude greater than the animating contest for freedom, go home and leave us in peace. We seek not your counsel, nor your arms. Crouch down and lick the hand that feeds you; and may posterity forget that ye were our countrymen. - Samuel Adams
next reply other threads:[~2002-06-07 21:56 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-06-07 14:56 Phil Edwards [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-06-07 14:36 spamjunk 2002-06-07 7:12 lerdsuwa 2002-06-06 6:36 spamjunk
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020607215602.22060.qmail@sources.redhat.com \ --to=phil@jaj.com \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).