From 1448835449789674784
X-Google-Thread: f78e5,3c7d746be594880e
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news3.google.com!news.glorb.com!news.alt.net!comp-std-cpp-robomod!not-for-mail
From: "Alf P. Steinbach" <alfps@start.no>
Newsgroups: comp.std.c++
Subject: Re: Concerning n2157 and is_empty specification
Date: Thu, 15 Mar 2007 12:56:07 CST
Organization: Altopia Corp. - Usenet Access - www.altopia.com
Lines: 30
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <55tff8F26esmvU1@mid.individual.net>
References: <1173648852.230192.11800@p10g2000cwp.googlegroups.com>   <howard.hinnant-B96105.15010612032007@johnf2.biosci.ohio-state.edu> <1173805078.208591.62140@v33g2000cwv.googlegroups.com> <55o7vqF261fmfU1@mid.individual.net> <C21DE90F.4B8F%greghe@pacbell.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
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
X-Orig-X-Trace: individual.net fLEC/M2ZZj/ydzvuirdGsQ1NgGoo9jtRngF3Cs+Nje+5jb9BXp
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051201 Thunderbird/1.5 Mnenhy/0.7.3.0
X-Originating-IP: 130.133.1.2
X-Virus-Scanned: amavisd-new at ucar.edu
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
Xref: g2news1.google.com comp.std.c++:8036

* Greg Herlihy:
> 
> Unfortunately, if std::is_empty<> template type trait is hacked in order to
> force is_empty<NonEmpty>::value to evaluate to false, then the is_empty<>
> template would no longer be able to test whether a class's base class was
> empty and - by extension - to test whether the complete class type may
> benefit from the EBCO. In fact, by returning inaccurate results is_empty<>
> would no longer have any discernable, useful purpose (that I can discern) -
> and would in fact have the less-than-useful effect of propagating the same
> errors, illogic and confusion evident in the C++ Templates book's discussion
> of empty class types into the C++ Standard itself.

Now, now.  Why not is_empty<NonEmpty, 0> yielding false, and 
is_empty<NonEmpty, 2> yielding true, where the number is the size of the 
derived class sans NonEmpty base?  That said, being very much less than 
a luminary in the forefront of C++ technology I'm not fully grokking the 
purpose of is_empty: is it for compiler writers?

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

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



