From -3219683103180240767
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,aef96954609d602c
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1993-08-17 13:05:35 PST
Path: gmd.de!xlink.net!howland.reston.ans.net!agate!doc.ic.ac.uk!pipex!sunic!news.lth.se!dag
From: dag@control.lth.se (Dag Bruck)
Newsgroups: comp.std.c++
Subject: Re: Template constraints
Date: 17 Aug 1993 18:46:03 GMT
Organization: Department of Automatic Control, Lund, Sweden
Lines: 25
Message-ID: <24r91b$6b9@nic.lth.se>
References: <rfgCB638z.2t3@netcom.com> <1993Aug4.182811.21153@ucc.su.OZ.AU> <rfgCBAw1F.7Hx@netcom.com> <m663quINNhtq@exodus.Eng.Sun.COM> <244rc6$g7i@nic.lth.se> <CBp6wn.FpH@hawnews.watson.ibm.com>
NNTP-Posting-Host: control.lth.se

In <comp.std.c++> jjb@watson.ibm.com (John Barton) writes:
>In article <244rc6$g7i@nic.lth.se>, dag@control.lth.se (Dag Bruck) writes:
>|> 
>|> So the idea is that you specify the minimum interface in a separate
>|> class declaration, and then only list the class name(s) in the
>|> template argument list.
>
>  Any compiler or C++ syntax analyzer can produce the information
>listed in T_templ above.  Having the programmer type it in is silly.

No.  First, the syntax analyser can only synthesize such information
if it has access to the complete source code for the template
class/function.  That may not be the case when the template
implementation resides in a separate file, and you may also want to
syntax check your own code with access to .h files only.

Second, a user-defined T_templ can define restrictions that are not
inherrent in the source code of the template definition.  You may
impose requirements based on planned template implementations etc.
that not actually needed with the current implementation.  For
example, you may require that array elements must have a default
constructor, just in case you want to implement element initialization
in some future release.

				-- Dag


