From 5078719068050390584
X-Google-Thread: 7894ca11fe,40de2bc986604261,start
X-Google-Attributes: gid7894ca11fe,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 02 Oct 2009 15:30:08 -0500
Return-Path: <cppmods@ruralroute.cs.rpi.edu>
To: (Usenet)
From: dps <servisster@gmail.com>
Newsgroups: comp.std.c++
Subject: Templates as default arguments
Organization: http://groups.google.com
Sender: cppmods@cs.rpi.edu
Approved: stephen.clamage@sun.com
Message-ID: <a9f9b3ad-96c5-4ad9-aca0-c50ec493b09e@z24g2000yqb.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
X-Original-Date: Fri, 2 Oct 2009 08:36:20 -0700 (PDT)
X-Submission-Address: std-c++@netlab.cs.rpi.edu
Date: Fri,  2 Oct 2009 15:21:37 CST
Lines: 36
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-Tfkf3znn1RDAAuvcLpg6KfCIGd/7AYBDRG5cbzUDMdOh84SbXnKZSVlWa7SHWtfp7E/ShlXVhC/7mVK!2nNsrIwmPpmIjlT/dKBhYIFv0zk/Pp1E6uFQ0/xqxQrVFaoubE4rwzLJEebwETPa6k9pEvz3UDNL!171vCFmbTTzSFsViHmoNlIWKHkQ=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
Xref: g2news2.google.com comp.std.c++:1419

Hi,

I have the following situation:

template<typename T, int i> class A
{
     A(){}
};

class B
{
public:
     B(A<double,3> arg=A<double,3>()){}
}

The above is pseudo-code and compiles on VS but not on gcc. Gcc
complains about the "3" in the default argument. But if I write

class B
{
public:
     typedef A<double,3> AD3;
     B(AD3 arg=AD3()){}

there is no problem. Obviously it has to do with the template
instantiation? But why is only the "3" that creates the problem?

Thanks a lot!
}

-- 
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



