Article View: comp.sys.mac.programmer.codewarrior
Article #592Re: template default argument bug?
From: Edward Chew
Date: Fri, 06 Feb 2004 17:22
Date: Fri, 06 Feb 2004 17:22
32 lines
2421 bytes
2421 bytes
Howard Hinnant wrote: > I think you've found a bug in Bjarne's book. I looked through his > errata and didn't see this issue already listed. If you contact him > with this information and if you are indeed the first to report it, then > I'm sure he will be very grateful. What? My C++ Bible has failed me? Say it isn't so! ;-) I wonder how may editions this affects? This is the one I have: The C++ Programming Language: Special Edition Bjarn Stroustrup Copyright 2000 by AT&T ISBN 0-201-70073-5 The offending example was in section 13.4.1 (page 340). Why do you suppose they don't allow default arguments in template functions anyway? They would certainly be useful. Ah well, so how about this one? If I instantiate something along the lines: TB<int,TA<int>> b; I get "Error: illegal template argument(s)". This error vanishes if I add one space like so: TB<int,TA<int> > b; Is this a compiler bug or another quirk in C++ (again, I am using CW 8.3)? -Ted
Technical Details
Message-ID:
<4023cd0a$1@news.kos.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!wn14feed!worldnet.att.net!199.45.49.37!cyclone1.gnilink.net!peer01.cox.net!cox.net!newsfeed.slurp.net!news.kos.net!not-for-mailReferences:
<4022896d$1@news.kos.net> <hinnant-B84BAE.17430705022004@syrcnyrdrs-03-ge0.nyroc.rr.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f635e,7802dbc009c85cd X-Google-Attributes: gidf635e,public X-Google-Thread: 10bcce,7802dbc009c85cd X-Google-Attributes: gid10bcce,public X-Google-ArrivalTime: 2004-02-06 09:22:51 PST Date: Fri, 06 Feb 2004 12:22:36 -0500 From: Edward Chew <ekc-noreply@lgl.kos.net> User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6a) Gecko/20031029 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac Subject: Re: template default argument bug? References: <4022896d$1@news.kos.net> <hinnant-B84BAE.17430705022004@syrcnyrdrs-03-ge0.nyroc.rr.com> In-Reply-To: <hinnant-B84BAE.17430705022004@syrcnyrdrs-03-ge0.nyroc.rr.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Original-NNTP-Posting-Host: 216.185.95.133 Message-ID: <4023cd0a$1@news.kos.net> X-Original-Trace: 6 Feb 2004 12:21:14 -0500, 216.185.95.133 Organization: Kingston Online Services Lines: 32 NNTP-Posting-Host: apollo.kos.net X-Trace: newsfeed.slurp.net 1076000329 199.246.2.51 (5 Feb 2004 11:58:49 -0500) X-Original-NNTP-Posting-Host: 199.246.2.51 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!wn14feed!worldnet.att.net!199.45.49.37!cyclone1.gnilink.net!peer01.cox.net!cox.net!newsfeed.slurp.net!news.kos.net!not-for-mail