public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "leslie dot barnes at amd dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/17445] too few template-parameter-lists Date: Tue, 19 Apr 2005 00:02:00 -0000 [thread overview] Message-ID: <20050419000204.22506.qmail@sourceware.org> (raw) In-Reply-To: <20040913003933.17445.carlson14@llnl.gov> ------- Additional Comments From leslie dot barnes at amd dot com 2005-04-19 00:02 ------- (In reply to comment #6) > This code has at least two bugs: > > template class MyType<Sample>; > template <> std::map<char*,char*> MyType<Sample>::m_map; > > First, the instantiation must come *after* the definition of the static > member. > Second, the definition you thought you have written is in fact only the > declaration of an explicit specialization of that member. It needs an > initializer. You need to write > > template <> std::map<char*,char*> MyType<Sample>::m_map > = std::map<char*,char*>(); > > W. > (In reply to comment #6) > This code has at least two bugs: > > template class MyType<Sample>; > template <> std::map<char*,char*> MyType<Sample>::m_map; > > First, the instantiation must come *after* the definition of the static > member. > Second, the definition you thought you have written is in fact only the > declaration of an explicit specialization of that member. It needs an > initializer. You need to write > > template <> std::map<char*,char*> MyType<Sample>::m_map > = std::map<char*,char*>(); > > W. > Great, thanks! If someone could put this on the g++ 3.4.3 changes page, that would probably save people quite a bit of time. http://www.gnu.org/software/gcc/gcc-3.4/changes.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445
next prev parent reply other threads:[~2005-04-19 0:02 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2004-09-13 0:39 [Bug c++/17445] New: " carlson14 at llnl dot gov 2004-09-13 1:03 ` [Bug c++/17445] " pinskia at gcc dot gnu dot org 2004-09-13 1:03 ` pinskia at gcc dot gnu dot org 2005-04-18 6:38 ` leslie dot barnes at amd dot com 2005-04-18 9:08 ` giovannibajo at libero dot it 2005-04-18 13:37 ` leslie dot barnes at amd dot com 2005-04-18 20:16 ` bangerth at dealii dot org 2005-04-19 0:02 ` leslie dot barnes at amd dot com [this message] 2005-04-19 14:08 ` bangerth at dealii dot org 2005-04-25 4:10 ` pinskia at gcc dot gnu dot org 2005-04-25 4:13 ` pinskia at gcc dot gnu dot org 2005-04-25 4:15 ` pinskia at gcc dot gnu dot org 2005-04-25 4:19 ` pinskia at gcc dot gnu dot org 2005-07-28 18:51 ` owen at titan dot com 2005-07-28 19:54 ` bangerth at dealii dot org
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=20050419000204.22506.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).