public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: corey taylor <corey.taylor@gmail.com>
To: Thomas Neumann <tneumann@users.sourceforge.net>
Cc: gcc-help@gnu.org
Subject: Re: template specializiation
Date: Thu, 07 Jul 2005 16:39:00 -0000	[thread overview]
Message-ID: <2e393d08050707092635054681@mail.gmail.com> (raw)
In-Reply-To: <42CD567F.2090702@users.sourceforge.net>

Thomas,

  Sure.  What version of Visual Studio are you using as I don't know
that I've had to use this in my MSVC development yet.

14.7.3.15

An explicit specialization of a static data member of a template is a
definition if the declaration includes an
initializer; otherwise, it is a declaration. [Note: there is no syntax
for the definition of a static data member
of a template that requires default initialization.
template<> X Q<int>::x;
This is a declaration regardless of whether X can be default
initialized (8.5). ]

corey

On 7/7/05, Thomas Neumann <tneumann@users.sourceforge.net> wrote:
> Hi,
> 
> > Would this not work for you?
> >
> 
> > template<> const A B<d>::b;
> > template<> const A B<c>::b;
> >
> > template<> const A B<c>::b = { &B<d>::b };
> > template<> const A B<d>::b = { &B<c>::b };
> 
> hmm, perhaps it _should_ work :) Gcc and Comeau accept it, but Microsoft
> and Borland complain about multiple definitions of B<d>::b and B<c>::d.
> Perhaps I see compiler bugs here, but I would think that they are right.
> Any pointers to the standard?
> 
> Thomas
>

  parent reply	other threads:[~2005-07-07 16:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-07 13:42 Thomas Neumann
2005-07-07 14:46 ` Eljay Love-Jensen
2005-07-07 15:25   ` corey taylor
2005-07-07 15:51     ` Thomas Neumann
2005-07-07 15:56       ` corey taylor
     [not found]         ` <42CD567F.2090702@users.sourceforge.net>
2005-07-07 16:39           ` corey taylor [this message]
2005-07-07 16:39           ` corey taylor
2005-07-07 19:34             ` Thomas Neumann

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=2e393d08050707092635054681@mail.gmail.com \
    --to=corey.taylor@gmail.com \
    --cc=gcc-help@gnu.org \
    --cc=tneumann@users.sourceforge.net \
    /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: link
Be 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).