Article View: comp.std.c++
Article #3436Re: Templates; what does the standard mean here...
From: David Vandevoorde
Date: Sat, 24 Feb 1996 17:15
Date: Sat, 24 Feb 1996 17:15
40 lines
2065 bytes
2065 bytes
>>>>> "DB" == David Byrden <100101.2547@compuserve.com> writes:
DB> From the January draft standard:
[...]
DB> template-argument:
DB> assignment-expression
DB> type-id
DB> template-name
DB> Notice the third-last line, "assignment-expression".
Assignment expressions are described in Chapter 5 ([expr.assign] or
something similar). They're basically your classical expression with
operation precedence downto assignments (e.g., not a comma-expression).
DB> Call me dumb, but I must ask what does this mean? What does the
DB> expression specify, a type or a value? Will an assignment be made at run
DB> time?
This is for non-type template arguments.
This is only the syntax description. In [temp.arg] you should find
that the expression must be a non-floating-type, constant expression
(i.e., one that can easily be determined at compile-time).
DB> Can you give me any examples of templates specialised with an
DB> assignment-expression?
template<bool B> struct PlaceHolder {};
PlaceHolder<(4<5)> hello_variable;
Daveed
[ To submit articles: Try just posting with your newsreader.
If that fails, use mailto:std-c++@ncar.ucar.edu
FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Technical Details
Message-ID:
<xso3f80spxf.fsf@avs.cs.rpi.edu>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageReferences:
<4gief4$pv6@news.bridge.net>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: vandevod@cs.rpi.edu (David Vandevoorde) Newsgroups: comp.std.c++ Subject: Re: Templates; what does the standard mean here... Date: 24 Feb 1996 17:15:14 GMT Organization: RPI Computer Science Sender: vandevod@avs.cs.rpi.edu Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <xso3f80spxf.fsf@avs.cs.rpi.edu> References: <4gief4$pv6@news.bridge.net> NNTP-Posting-Host: taumet.eng.sun.com X-Nntp-Posting-Host: avs.cs.rpi.edu In-Reply-To: David Byrden's message of 22 Feb 96 20:22:36 GMT X-Newsreader: Gnus v5.1 Originator: clamage@taumet