From 3024274007533864777
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,94948bbb031f36b
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-09-25 09:20:31 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: cpdaniel@pacbell.net ("Carl Daniel")
Newsgroups: comp.std.c++
Subject: Re: how to define a template function with a templatized parameter
Date: Wed, 25 Sep 2002 16:20:30 +0000 (UTC)
Organization: Prodigy Internet http://www.prodigy.com
Lines: 49
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <7Zjk9.816$qS4.58639644@newssvr13.news.prodigy.com>
References: <3D8D2E06.9D30B9D@optech.com> <ptv5f3ag.fsf@nortelnetworks.com> <3D918C6B.7000302@ex-parrot.com>
X-Trace: mail2news.demon.co.uk 1032970830 18074 10.0.0.1 (25 Sep 2002 16:20:30 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 25 Sep 2002 16:20:30 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.05)
	id 17uEtp-0004hN-00
	for mail2news@news.news.demon.net; Wed, 25 Sep 2002 16:20:29 +0000
X-Received: by mulga.cs.mu.OZ.AU
	id CAA25795; Thu, 26 Sep 2002 02:20:25 +1000 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ncar.ucar.edu
X-Newsgroups: comp.std.c++
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-NNTP-Posting-Date: Wed, 25 Sep 2002 10:44:19 EDT
X-UserInfo1: OPYSC_WEUCRQRW@YKBH\OQMAPJYREUDKFA_J]Q]KEYUNDQUCCNSUAACY@L[ZX__HGFD]JBJNSFXTOOGA_VWY^_HG@FW_HUTHOH]TBPGCO\P^PLP^@[GLHUK@WLECKFVL^TYG[@RMWQXIWM[SDDYWNLG_G[_BWUCHFY_Y@AS@Q[B\APPF@DCZM_PG_VSCPQZM
X-MailScanner: PASSED (v1.2.6 61110 g8PEiKfu086501 mailbox4.ucsd.edu)
Xref: archiver1.google.com comp.std.c++:14189

"Richard Smith" <richard@ex-parrot.com> wrote in message
news:3D918C6B.7000302@ex-parrot.com...

> DR #150 [http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_closed.html#150]
> raises this particular issue with the example
>
>      template <class T, class U = int>
>      class ARG { };
>
>      template <class X, template <class Y> class PARM>
>      void f(PARM<X>) { }    // specialization permitted?
>
>      void g() {
>          ARG<int> x;        // actually ARG<int, int>
>          f(x);              // does ARG (2 parms, 1 with default)
>                             // match PARM (1 parm)?
>
> which is effectively the same issue.  This was closed 'Not A Defect', in
> October '99 with the rationale,
>
>      Template template parameters are intended to be handled analogously
>      to function function parameters. Thus the number of parameters in a
>      template template argument must match the number of parameters in a
>      template template parameter, regardless of whether any of those
>      paramaters have default arguments or not. [...]

Yeah.  I think the committee made a very poor choice there by choosing to
disambiguate the language towards the less useful interpretation.  It's
interesting to note that a number of compilers have accepted the more
liberal and useful interpretation that says that template-template
parameters have to be "call compatible", using the analogy of calling a
function, rather than taking the address of a function.  IMO, this is the
more intuitive intepretation as well, since "we all know" that templates are
a compile-time facility, and any analogy between template parameters and
function pointers is grossly aritificial.

I've never heard any implementation argument that says that the more liberal
interpretation is harder to implement, or less safe to use - perhaps there
is one when export in considered.?

-cd


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



