220 4713 <a077c61e-bf59-4d4d-8aa4-b6a810e47595@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Remove vector<bool>?
Date: Wed, 29 May 2013 12:21:25 -0700 (PDT)
Lines: 143
Approved: news@gmane.org
Message-ID: <a077c61e-bf59-4d4d-8aa4-b6a810e47595@isocpp.org>
References: <CAGsORuDQdeWAO5yjA6=h0hW9Y0Sj4F1gcHB61udw5JFmtx+g4Q@mail.gmail.com>
 <83a68179-f8cd-42e9-a880-2bd797b30c28@isocpp.org>
 <CAGg_6+NDacUk23QRd5PTNKG5XYHaw9e18r4COD-6SzQM9vTZbg@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_1954_14671050.1369855285276"
X-Trace: ger.gmane.org 1369855288 21137 80.91.229.3 (29 May 2013 19:21:28 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 29 May 2013 19:21:28 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBN5KTGGQKGQEQMEVR5Y@isocpp.org Wed May 29 21:21:30 2013
Return-path: <std-proposals+bncBCEKFTV6ZUMBBN5KTGGQKGQEQMEVR5Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f199.google.com ([209.85.223.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBN5KTGGQKGQEQMEVR5Y@isocpp.org>)
	id 1Uhlw8-0000XD-Hr
	for gclcip-std-proposals@m.gmane.org; Wed, 29 May 2013 21:21:28 +0200
Original-Received: by mail-ie0-f199.google.com with SMTP id 9sf14241483iec.2
        for <gclcip-std-proposals@m.gmane.org>; Wed, 29 May 2013 12:21:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere:date:from:to:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=LXyGCNEXJfh3wPmTbBZLZBf61xqf5x2XBVoz2kDPL3U=;
        b=gcuaQ1YqUYB4XIjkri70J9gxOtsltT+OES8VJgU0mwA3BTtf/T0KZlrt3ubRJFPxR6
         VWwH3faIC8nqMD47pixY1TH7P2akKhI8RVRnlpYQ+F1Ca0sjCH/z7qcEh2IVBpxjK1Es
         762Ueum5kx1m9SH2rX0ronyZS54rN+yK+Lho5RN8VilsK8mpnbfK+pthsrN3PepmQojR
         2jvvI6xxkkujRfaQmaSn3e8oOmz/M1HTy+9NPFB9pZfgVPz8QHoe88dfJojp2Ua2peVj
         3xwjPN0xX+VV+WhnUqr4/b3M5VcUtrxG5PyIMfnG/rqp5Gbx1x6HQT1LLIlI2IMlbGBx
         j8Xw==
X-Received: by 10.50.78.42 with SMTP id y10mr17479429igw.0.1369855287636;
        Wed, 29 May 2013 12:21:27 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.222.170 with SMTP id qn10ls31475igc.6.gmail; Wed, 29 May
 2013 12:21:26 -0700 (PDT)
X-Received: by 10.50.101.39 with SMTP id fd7mr681332igb.16.1369855286723;
        Wed, 29 May 2013 12:21:26 -0700 (PDT)
In-Reply-To: <CAGg_6+NDacUk23QRd5PTNKG5XYHaw9e18r4COD-6SzQM9vTZbg@mail.gmail.com>
X-Original-Sender: jmckesson@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:4713
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4713>

------=_Part_1954_14671050.1369855285276
Content-Type: text/plain; charset=ISO-8859-1

On Wednesday, May 29, 2013 10:51:42 AM UTC-7, Nevin ":-)" Liber wrote:
>
> On 29 May 2013 12:42, Nicol Bolas <jmck...@gmail.com <javascript:>> wrote:
>
>>
>>   http://www.gotw.ca/publications/N1185.pdf 
>>>
>>> But it's not adopted. 
>>>
>>> Anyway, vector<bool> sucks, and we know it.  How about to entirely 
>>> remove it? 
>>>
>>
>>
>>
>> We simply add another specialization to `vector` called 
>> "vector<std::real_bool, Allocator>". If you create a `vector` with the 
>> `std::real_bool` type, then you get exactly what you would have gotten if 
>> `vector<bool>` weren't a specialization: an actual `vector` that contains 
>> actual `bool`s. The `value_type` of `vector<std::real_bool>` would be 
>> `bool`, and so forth.
>>
>> We don't have to get rid of `vector<bool>` to get what we want. We just 
>> have to call it something else. And since this `std::real_bool` type can't 
>> be used in existing code (defining new things in the `std` namespace is 
>> undefined behavior), it can't conflict with anything now.
>>
>> The downside is that a template function that takes a `vector<T>`, where 
>> `T` is some type, may assume that `T` is the `value_type` of the `vector`, 
>> which it would not be in the case of `std::real_bool`.
>>
>
> -1.
>
> The primary argument (so far) for removing the vector<bool> specialization 
> is uniformity with the rest of vector.
>

I thought the primary argument was to be able to create a `vector` of 
`bool`s. I don't care about "uniformity"; what I care about is making a 
`vector` that actually contains `bool`s.

As you point out, your solution still doesn't achieve it.
>
> While the standard strives for high levels of backwards compatibility, it 
> need not be 100% (heck, C++11 vector is not 100% backwards compatible with 
> C++03 vector), and we shouldn't be adding more warts.  The standard is the 
> right place to fix this, and we should fix it and not just put a band aid 
> on it.
>

And how long will that take? C++14 is closed for new stuff, and the whole 
"deprecation/removal" process will require at least 2 revisions. So it 
would be C++20 *at least* before we can finally create a real `vector` of 
real `bool`s.

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.



------=_Part_1954_14671050.1369855285276
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Wednesday, May 29, 2013 10:51:42 AM UTC-7, Nevin ":-)" Liber wrote:<bloc=
kquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-l=
eft: 1px #ccc solid;padding-left: 1ex;">On 29 May 2013 12:42, Nicol Bolas <=
span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscat=
ed-mailto=3D"kVPNKppxaKIJ">jmck...@gmail.com</a>&gt;</span> wrote:<br><div =
class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0=
 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><br><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.=
8ex;border-left:1px #ccc solid;padding-left:1ex">&nbsp; <a href=3D"http://w=
ww.gotw.ca/publications/N1185.pdf" target=3D"_blank">http://www.gotw.ca/<wb=
r>publications/N1185.pdf</a>
<br>
<br>But it's not adopted.
<br>
<br>Anyway, vector&lt;bool&gt; sucks, and we know it. &nbsp;How about to en=
tirely
<br>remove it?
<br></blockquote></div><div><br><br><br>We simply add another specializatio=
n to `vector` called "vector&lt;std::real_bool, Allocator&gt;". If you crea=
te a `vector` with the `std::real_bool` type, then you get exactly what you=
 would have gotten if `vector&lt;bool&gt;` weren't a specialization: an act=
ual `vector` that contains actual `bool`s. The `value_type` of `vector&lt;s=
td::real_bool&gt;` would be `bool`, and so forth.<br>

<br>We don't have to get rid of `vector&lt;bool&gt;` to get what we want. W=
e just have to call it something else. And since this `std::real_bool` type=
 can't be used in existing code (defining new things in the `std` namespace=
 is undefined behavior), it can't conflict with anything now.<br>

<br>The downside is that a template function that takes a `vector&lt;T&gt;`=
, where `T` is some type, may assume that `T` is the `value_type` of the `v=
ector`, which it would not be in the case of `std::real_bool`.<br></div>

</blockquote><div><br>-1.<br><br>The primary argument (so far) for removing=
 the vector&lt;bool&gt; specialization is uniformity with the rest of vecto=
r.</div></div></blockquote><div><br>I thought the primary argument was to b=
e able to create a `vector` of `bool`s. I don't care about "uniformity"; wh=
at I care about is making a `vector` that actually contains `bool`s.<br><br=
></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.=
8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div class=3D"gmail_quo=
te"><div>As you point out, your solution still doesn't achieve it.<br><br>

While the standard strives for high levels of backwards compatibility, it n=
eed not be 100% (heck, C++11 vector is not 100% backwards compatible with C=
++03 vector), and we shouldn't be adding more warts.&nbsp; The standard is =
the right place to fix this, and we should fix it and not just put a band a=
id on it.</div></div></blockquote><div><br>And how long will that take? C++=
14 is closed for new stuff, and the whole "deprecation/removal" process wil=
l require at least 2 revisions. So it would be C++20 <i>at least</i> before=
 we can finally create a real `vector` of real `bool`s.<br></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

------=_Part_1954_14671050.1369855285276--

.
