From -7949383470324069119
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f78e5,eaeb4b8245d8b1d6
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-02-11 20:04:36 PST
Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!newsfeed.gamma.ru!Gamma.RU!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: hyrosen@mail.com (Hyman Rosen)
Newsgroups: comp.std.c++
Subject: Re: proposal?: template interfaces
Date: Wed, 12 Feb 2003 04:04:31 +0000 (UTC)
Organization: KBC Financial Products
Lines: 39
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <1044985656.745750@master.nyc.kbcfp.com>
References: <23478c42.0302102345.244450c8@posting.google.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Trace: mail2news.demon.co.uk 1045022671 20196 10.0.0.1 (12 Feb 2003 04:04:31 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 12 Feb 2003 04:04:31 +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 18io8L-0005Fa-00
	for mail2news@news.news.demon.net; Wed, 12 Feb 2003 04:04:29 +0000
X-Received: by mulga.cs.mu.OZ.AU
	id PAA03295; Wed, 12 Feb 2003 15:04:22 +1100 (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-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030130
X-Accept-Language: en-us, en
X-Newsgroups: comp.std.c++
X-Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com
X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/)
X-MIME-Autoconverted: from 8bit to quoted-printable by cmr2.ash.ops.us.uu.net id QQobpn26357
X-Spam-Status: No, hits=-11.3 required=5.0
	tests=IN_REP_TO,NOSPAM_INC,QUOTED_EMAIL_TEXT,REFERENCES,
	      SPAM_PHRASE_00_01,USER_AGENT,USER_AGENT_MOZILLA_UA,
	      X_ACCEPT_LANG
	version=2.41
X-MIME-Autoconverted: from quoted-printable to 8bit by mulga.cs.mu.OZ.AU id EAA10561
X-MIME-Autoconverted: from 8bit to quoted-printable by mulga.cs.mu.OZ.AU id PAA03295
Xref: archiver1.google.com comp.std.c++:17906

danielgutson@hotmail.com wrote:
> often it is not clear what the class will
 > use from the template parameter.

The author of the class should document this.

> I have no clear what should I provide as an allocator :)

See 20.4.1.

> In other ways, it=B4s a legalization of parameterized inheritance.

The problem is that usage in templates cannot be covered
by simple method requirements. For example, if I write

     template <typename OS, typename T>
     OS &print(OS &os, const T &t)
     { return os << t; }

what kind of requirements could you give for OS and T
that would cover the various possibilities of member
functions, standalone methods, Koenig lookup, and
automatic conversions that are possible?

Like 'final' and the other restrictive proposals that abound,
all this would have the effect of preventing useful code from
working, because the original writer will have failed to forsee
a use, and will have ruled it out through a restriction.

You can describe template requirements to your users using
words. If clients fail to meet those requirements, the code
won't compile, just as if your proposal was in place.

---
[ 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                       ]



