From -6244277021509432313
X-Google-Thread: f78e5,cba1ff9ceb231a4,start
X-Google-Attributes: gidf78e5,public,usenet
X-Google-Language: ENGLISH,ASCII
Path: g2news1.google.com!news2.google.com!news.glorb.com!news.alt.net!comp-std-cpp-robomod!not-for-mail
From: =?iso-8859-1?q?Daniel_Kr=FCgler?= <daniel.kruegler@googlemail.com>
Newsgroups: comp.std.c++
Subject: Integer conversion rank implementation-defined?
Date: Sat, 21 Jul 2007 04:52:57 CST
Organization: http://groups.google.com
Lines: 39
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <1184969707.151813.156000@n60g2000hse.googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1184969707 12461 127.0.0.1 (20 Jul 2007 22:15:07 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 20 Jul 2007 22:15:07 +0000 (UTC)
Return-Path: <devnull@stump.algebra.com>
X-Authentication-Warning: mulga.csse.unimelb.edu.au: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Original-To: std-c++@mailman.ucar.edu
Delivered-To: std-c++@mailman.ucar.edu
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: n60g2000hse.googlegroups.com; posting-host=85.177.35.121;
   posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
X-MIME-Autoconverted: from quoted-printable to 8bit by mulga.csse.unimelb.edu.au id l6KMHa6h001652
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
Xref: g2news1.google.com comp.std.c++:8978

The most recent draft N2315 says in [conv.rank]/p.1:

"The rank of any extended signed integer type relative to another
extended signed integer type with the same size is
implementation-defined, but still subject to the other rules for
determining the integer conversion rank."

Does that mean that an implementation is required to document
the rank values of extended integer types? Or is this an oversight
and should the word "implementation-defined" in this sentence be
changed to "unspecified"?

Assuming, it really should mean "implementation-defined", I
propose to follow the way, Fortran 90 does it with its "Kind"
values and to make them available for programmers, e.g. via
a new type trait. What about

template <class T> struct integer_rank;

?

Such a trait class would also allow programmers to write code
that deduces the real underlying type of an enumeration (which
is not unambigiously possible with a chain of sizeof tests).

N.B: From Sunday on I'm on vacations - Please don't wonder if
my answer follows later!

Greetings from Bremen,

Daniel Kr�gler


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



