From 1042190127128822694
X-Google-Thread: f78e5,c9a289c55d59e43d
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news2.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: brangdon@cix.co.uk (Dave Harris)
Newsgroups: comp.std.c++
Subject: Re: non-type template parameter in the new std.
Date: Tue, 18 Jul 2006 12:01:42 GMT
Lines: 34
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <memo.20060718092048.676A@brangdon.cix.compulink.co.uk>
References: <1152726032.559269.324790@75g2000cwc.googlegroups.com>
NNTP-Posting-Host: news.news.demon.net
X-Trace: news.demon.co.uk 1153224106 16173 158.152.254.254 (18 Jul 2006 12:01:46 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Tue, 18 Jul 2006 12:01:46 +0000 (UTC)
X-Original-To: std-c++@mailman.ucar.edu
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Orig-X-Trace: individual.net zlrRIn1+B3iHeK1eEhMm3Q3zwEtjb0rrAoqG8Sd6XWeMNAxSY=
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
X-Reply-To: brangdon@cix.co.uk
X-Received: (from fjh@localhost)
	by mulga.csse.unimelb.edu.au (8.13.6+Sun/8.13.6/Submit) id k6IC1gsW023555;
	Tue, 18 Jul 2006 22:01:42 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
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++:2814

richard@ex-parrot.com (Richard Smith) wrote (abridged):
> werasm wrote:
> > 1) Are floating point numbers non-type template parameters in the
> > latest standard.
> 
> Not at present.  The rationale being that when cross compiling, the
> compiler would need to exactly emulate the floating point behaviour of
> the target processor, right down to the details of rounding, handling
> of NaNs and infinites, etc.

Actually, as I understand it the problem is one of type checking. Given:

    template <double v> struct X {};
    
    void func( X<0.3333> ) {}
    void func( X<1.0/3.0> ) {}

is this two definitions of the same function that violates the 
one-definition rule, or are there two functions that take arguments of 
different types? The answer depends on the precision of the floating 
point, so we can't say whether the program is type-correct without knowing 
more about the implementation than we should.

This is not really about cross-compiling. It is about *all* compilers 
being consistent, rather than one compiler emulating one other processor.

-- Dave Harris, Nottingham, UK.

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



