From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16903 invoked by alias); 7 Jul 2005 16:39:51 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 12939 invoked by uid 22791); 7 Jul 2005 16:36:12 -0000 Received: from monty-python.gnu.org (HELO monty-python.gnu.org) (199.232.76.173) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 07 Jul 2005 16:36:12 +0000 Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DqZOs-0003Hy-1Z for gcc-help@gcc.gnu.org; Thu, 07 Jul 2005 12:38:58 -0400 Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.34) id 1DqZB6-0005ip-VC for gcc-help@gnu.org; Thu, 07 Jul 2005 12:24:45 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1DqZJ8-0002lo-Ua for gcc-help@gnu.org; Thu, 07 Jul 2005 12:33:03 -0400 Received: from [64.233.184.192] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DqZJ8-0002lh-MH for gcc-help@gnu.org; Thu, 07 Jul 2005 12:33:02 -0400 Received: by wproxy.gmail.com with SMTP id 68so232325wri for ; Thu, 07 Jul 2005 09:26:19 -0700 (PDT) Received: by 10.54.23.59 with SMTP id 59mr890263wrw; Thu, 07 Jul 2005 09:26:18 -0700 (PDT) Received: by 10.54.72.9 with HTTP; Thu, 7 Jul 2005 09:26:18 -0700 (PDT) Message-ID: <2e393d08050707092635054681@mail.gmail.com> Date: Thu, 07 Jul 2005 16:39:00 -0000 From: corey taylor Reply-To: corey taylor To: Thomas Neumann Subject: Re: template specializiation Cc: gcc-help@gnu.org In-Reply-To: <42CD567F.2090702@users.sourceforge.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <42CD3120.5040906@users.sourceforge.net> <6.2.1.2.2.20050707085151.025778e0@iplan-mn.corp.adobe.com> <2e393d0805070708244eab1d94@mail.gmail.com> <42CD4F43.8090700@users.sourceforge.net> <2e393d0805070708567c627576@mail.gmail.com> <42CD567F.2090702@users.sourceforge.net> X-SW-Source: 2005-07/txt/msg00084.txt.bz2 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::x; This is a declaration regardless of whether X can be default initialized (8.5). ] corey On 7/7/05, Thomas Neumann wrote: > Hi, >=20 > > Would this not work for you? > > >=20 > > template<> const A B::b; > > template<> const A B::b; > > > > template<> const A B::b =3D { &B::b }; > > template<> const A B::b =3D { &B::b }; >=20 > hmm, perhaps it _should_ work :) Gcc and Comeau accept it, but Microsoft > and Borland complain about multiple definitions of B::b and B::d. > Perhaps I see compiler bugs here, but I would think that they are right. > Any pointers to the standard? >=20 > Thomas >