From 3171882917728389780
X-Google-Thread: f78e5,c9a289c55d59e43d
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news3.google.com!news4.google.com!news.glorb.com!peer1.news.newnet.co.uk!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: gdr@cs.tamu.edu (Gabriel Dos Reis)
Newsgroups: comp.std.c++
Subject: Re: non-type template parameter in the new std.
Date: Mon, 17 Jul 2006 20:37:53 GMT
Organization: Texas A&M University, College Station, Texas
Lines: 42
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <Pine.GSO.4.58.0607171532340.2602@sun>
References: <1152697717.720355.314370@35g2000cwc.googlegroups.com>  
 <1152726032.559269.324790@75g2000cwc.googlegroups.com>  
 <Pine.GSO.4.58.0607162111540.16205@sun>   <1153129969.041331.207920@35g2000cwc.googlegroups.com>
 <1153146831.083155.255040@35g2000cwc.googlegroups.com>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Trace: news.demon.co.uk 1153168679 13609 158.152.254.254 (17 Jul 2006 20:37:59 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Mon, 17 Jul 2006 20:37:59 +0000 (UTC)
X-Original-To: std-c++@mailman.ucar.edu
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
X-Received: (from fjh@localhost)
	by mulga.csse.unimelb.edu.au (8.13.6+Sun/8.13.6/Submit) id k6HKbrQw025480;
	Tue, 18 Jul 2006 06:37:53 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-NNTP-Posting-Date: 17 Jul 2006 20:35:16 GMT
X-Delivered-To: std-c++@mailman.ucar.edu
X-Authentication-Warning: mulga.csse.unimelb.edu.au: fjh set sender to devnull@stump.algebra.com using -f
X-Newsgroups: comp.std.c++
Xref: g2news2.google.com comp.std.c++:2800

On Mon, 17 Jul 2006, werasm wrote:

|
| kanze wrote:
| > Gabriel Dos Reis wrote:
| > > How about
| >
| > >     template<auto Min, auto Max>
| > >       struct foo { };
| > But how do you name the type within the template?
|
| I'm wondering about why auto would be necessary when the type could be
| derived from the literal (my original example: template <T min, T
| max>).

An issue is that every use of a name (here your "T") must be
preceded by a declaration that introduces it in scope.  C++ isn't ML.

| I've given the explanation as to why I think it not necessary,
| and no one has commented as yet.

I don't believe your explanation correctly handles the language
reuqirements.

| I suppose if one wants to refer to the type, in the event of it (an
| auto keyword) being necessary, one could use:
|
| template <auto<T> min, auto<T> max> or ...
| template <auto<T> min, auto<T2> max> etc.

-- 
                                                        Gabriel Dos Reis
                                                         gdr@cs.tamu.edu
	Texas A&M University -- Department of Computer Science
	301, Bright Building -- College Station, TX 77843-3112

---
[ 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.comeaucomputing.com/csc/faq.html                      ]



