From 5223442343827469747
X-Google-Thread: f78e5,1bbe7bb366a41a58,start
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII
Path: g2news2.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.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: Defect report: Impossible "as if" clauses
Date: Tue, 20 Feb 2007 12:07:11 CST
Organization: http://groups.google.com
Lines: 55
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <1171837048.725352.167610@v45g2000cwv.googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1171837054 3522 127.0.0.1 (18 Feb 2007 22:17:34 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 18 Feb 2007 22:17:34 +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.1) Gecko/20061204 Firefox/2.0.0.1,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: v45g2000cwv.googlegroups.com; posting-host=89.48.243.97;
   posting-account=0YhmiQ0AAABRDjD_6coNmBVB3rgPlaOq
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 l1IMHhNE018274
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
Xref: g2news2.google.com comp.std.c++:5643

The current standard 14882:2003(E) as well as N2134 have the
following
defects:

27.8.1.1/5 says:

"In order to support file I/O and multibyte/wide character
conversion,
conversions are performed using members of a facet, referred to as
a_codecvt in following sections, obtained ''as if'' by
codecvt<charT,char,typename traits::state_type> a_codecvt =
use_facet<codecvt<charT,char,typename traits::state_type>
>(getloc());"

use_facet returns a const facet reference and no facet is
copyconstructible,
so the codecvt construction should fail to compile.

A similar issue arises in 22.2.2.2.2/15 for num_punct.

Proposed resolution:
In 27.8.1.1/5 change the "as if" code from

codecvt<charT,char,typename traits::state_type> a_codecvt =
use_facet<codecvt<charT,char,typename traits::state_type> >(getloc());

to

const codecvt<charT,char,typename traits::state_type>& a_codecvt =
use_facet<codecvt<charT,char,typename traits::state_type> >(getloc());

In 22.2.2.2.2/15 (This is para 5 in N2134) change

A local variable punct is initialized via
numpunct<charT> punct = use_facet< numpunct<charT> >(str.getloc())

to

A local variable punct is initialized via
const numpunct<charT>& punct = use_facet< numpunct<charT>
>(str.getloc());

(Please note also the additional provided trailing semicolon)

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                      ]



