220 4729 <51A670DC.2010102@wanadoo.fr> article
Path: news.gmane.org!not-for-mail
From: "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Remove vector<bool>?
Date: Wed, 29 May 2013 23:19:24 +0200
Lines: 215
Approved: news@gmane.org
Message-ID: <51A670DC.2010102@wanadoo.fr>
References: <CAGsORuDQdeWAO5yjA6=h0hW9Y0Sj4F1gcHB61udw5JFmtx+g4Q@mail.gmail.com> <CAGg_6+O9XJucMxwEhU+50Dzx0Tz7XRK0cWyrkUHuPSoEz9TqEw@mail.gmail.com> <e59c2a57-6068-4098-8667-5d086b2961fd@isocpp.org> <7371f4b8-8c47-4f17-af1e-902a5c8b17e4@isocpp.org> <FF769E17-643C-47FE-8A3E-D28436A4B9A6@gmail.com> <51A638CF.5050905@wanadoo.fr> <CAGg_6+OS21ww71D-94NO0f0pLUDo6fGUULdZ6KkVc0aypwf_uw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="------------030901000709050908050009"
X-Trace: ger.gmane.org 1369862368 1595 80.91.229.3 (29 May 2013 21:19:28 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 29 May 2013 21:19:28 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDH67CONY4PBBXPBTGGQKGQEGF327GI@isocpp.org Wed May 29 23:19:28 2013
Return-path: <std-proposals+bncBDH67CONY4PBBXPBTGGQKGQEGF327GI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lb0-f200.google.com ([209.85.217.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDH67CONY4PBBXPBTGGQKGQEGF327GI@isocpp.org>)
	id 1UhnmI-0002NU-KD
	for gclcip-std-proposals@m.gmane.org; Wed, 29 May 2013 23:19:26 +0200
Original-Received: by mail-lb0-f200.google.com with SMTP id w20sf7581002lbh.11
        for <gclcip-std-proposals@m.gmane.org>; Wed, 29 May 2013 14:19:26 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=x-beenthere:message-id:date:from:user-agent:mime-version:to:subject
         :references:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=EsIjT6U+FKyTxmlugvCBbdnWMrsjvLTpxAK23dujY9I=;
        b=aNQjdy1VF7i3ONYhiQ36/geISP/IKLzvINdFTL+70wE7ch9ce6IEj+Y4+/e3lkAX49
         4kMR5yTShKhKK4Tnhkm2S9MUPa9c9yRP+ccz9sQoduTr3u8y4X7WBGXiTjw6lm/wc+Bf
         sh/QKsRsiQ3WvGCQdU8G8VTZnCVZUCIjgSzlIlg7SEo/vSArs+T1/SGsVxMLOTBncdZA
         j8u2q694WSIjqcsc8xqSrkv9nYFV46+Sq5aYXfrauOLqg11MpU9KK/D+l12UiU+Lof+T
         8QXCrZGjDUFgezSN0bZ+g78G0mK3l08Xyfxh4Eg2g/GYBmNyqzO6VG8lHvhbcg/o+6rr
         mqEw==
X-Received: by 10.180.188.98 with SMTP id fz2mr7106615wic.4.1369862366090;
        Wed, 29 May 2013 14:19:26 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.36.231 with SMTP id t7ls1706418wij.32.canary; Wed, 29 May
 2013 14:19:25 -0700 (PDT)
X-Received: by 10.14.95.4 with SMTP id o4mr6606963eef.2.1369862365428;
        Wed, 29 May 2013 14:19:25 -0700 (PDT)
Original-Received: from smtp.smtpout.orange.fr (smtp06.smtpout.orange.fr. [80.12.242.128])
        by mx.google.com with ESMTP id v8si23051291eeg.185.2013.05.29.14.19.25
        for <std-proposals@isocpp.org>;
        Wed, 29 May 2013 14:19:25 -0700 (PDT)
Received-SPF: neutral (google.com: 80.12.242.128 is neither permitted nor denied by best guess record for domain of vicente.botet@wanadoo.fr) client-ip=80.12.242.128;
Original-Received: from pc4.home ([2.11.193.225])
	by mwinf5d29 with ME
	id hxKQ1l00H4sEqES03xKQGi; Wed, 29 May 2013 23:19:25 +0200
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
In-Reply-To: <CAGg_6+OS21ww71D-94NO0f0pLUDo6fGUULdZ6KkVc0aypwf_uw@mail.gmail.com>
X-Original-Sender: vicente.botet@wanadoo.fr
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 80.12.242.128 is neither permitted nor denied by best guess
 record for domain of vicente.botet@wanadoo.fr) smtp.mail=vicente.botet@wanadoo.fr
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:4729
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4729>

This is a multi-part message in MIME format.
--------------030901000709050908050009
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Le 29/05/13 19:37, Nevin Liber a =E9crit :
> On 29 May 2013 12:20, Vicente J. Botet Escriba=20
> <vicente.botet@wanadoo.fr <mailto:vicente.botet@wanadoo.fr>> wrote:
>
>     Le 28/05/13 22:12, Howard Hinnant a =E9crit :
>>     On May 28, 2013, at 4:00 PM, Nicol Bolas<jmckesson@gmail.com>  <mail=
to:jmckesson@gmail.com>  wrote:
>>
>>>     Personally, I agree with Howard; we should add a class that has all=
 of this functionality (presumably with some degree of required sizing) tha=
t would be a drop-in replacement for those who need the sizing features of =
vector<bool>. But the question remains: even with a drop-in replacement, ho=
w much code will be broken because of this?
>>     Model this after the auto_ptr -> unique_ptr transition:
>>
>>     Step 1:  Introduce bit_vector (or whatever) and deprecate the vector=
<bool> specialization.  /Somehow/ motivate people to migrate.
>     I think that we will need also to add a std::*new_*vector<T> that
>     behaves like std::vector<T> but doesn't have the bool
>     specialization and *deprecate* std::vector :->
>
>
> -100.
>
> * Annoying 99% of all C++ users is a horrible, horrible idea.
Right. Forget the last sentence.
>
> * I'd hate to use a code base that had two different, unrelated types=20
> for doing the exact same thing, since ultimately these things end up=20
> interfaces.  Actually, I already have that, as people are trying to=20
> migrate from Boost over to std (such as shared_ptr), and it is=20
> anything but easy (because we are dependent on libraries developed=20
> for/by other groups, and changing those interfaces is a scheduling=20
> nightmare).
You are right. What we would need is 'single' type that behaves as the=20
current vector<T> except for bool and that behaves as vector<bool> if=20
vector was not specialized. I don't know if we can specialize an alias=20
and if the following is correct

template <typename T, typename Allocator>
class new_vector { the same definition as vector<T, Allocator> now };

template <typename T, typename Allocator>
alias vector=3D new_vector<T, Allocator> ;

template < typename Allocator>
class vector<bool, Allocator> { the same definition as now } ;

If this is correct, users of vector would get the same behavior. Users=20
of new_vector would get the behavior without the bool specialization.
Any function expecting a vector<T> work with new_vector<T> except for=20
bool. The same is valid for function expecting new_vector<T> you can use=20
it with vector<T> except for bool.

Of course we need a bit_vector class that replace the vector<bool>=20
specialization as Howard suggested.
After the deprecation period, new_vector and vector would have the same=20
behavior and new_vector could be deprecated at his turn.


Vicente

--=20

---=20
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 e=
mail 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-proposa=
ls/?hl=3Den.



--------------030901000709050908050009
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<html>
  <head>
    <meta content=3D"text/html; charset=3DISO-8859-1"
      http-equiv=3D"Content-Type">
  </head>
  <body bgcolor=3D"#FFFFFF" text=3D"#000000">
    <div class=3D"moz-cite-prefix">Le 29/05/13 19:37, Nevin Liber a
      &eacute;crit&nbsp;:<br>
    </div>
    <blockquote
cite=3D"mid:CAGg_6+OS21ww71D-94NO0f0pLUDo6fGUULdZ6KkVc0aypwf_uw@mail.gmail.=
com"
      type=3D"cite">On 29 May 2013 12:20, Vicente J. Botet Escriba <span
        dir=3D"ltr">&lt;<a moz-do-not-send=3D"true"
          href=3D"mailto:vicente.botet@wanadoo.fr" target=3D"_blank">vicent=
e.botet@wanadoo.fr</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 bgcolor=3D"#FFFFFF" text=3D"#000000">
            <div>Le 28/05/13 22:12, Howard Hinnant a &eacute;crit&nbsp;:<br=
>
            </div>
            <div class=3D"im">
              <blockquote type=3D"cite">
                <pre>On May 28, 2013, at 4:00 PM, Nicol Bolas <a moz-do-not=
-send=3D"true" href=3D"mailto:jmckesson@gmail.com" target=3D"_blank">&lt;jm=
ckesson@gmail.com&gt;</a> wrote:

</pre>
                <blockquote type=3D"cite">
                  <pre>Personally, I agree with Howard; we should add a cla=
ss that has all of this functionality (presumably with some degree of requi=
red sizing) that would be a drop-in replacement for those who need the sizi=
ng features of vector&lt;bool&gt;. But the question remains: even with a dr=
op-in replacement, how much code will be broken because of this?
</pre>
                </blockquote>
                <pre>Model this after the auto_ptr -&gt; unique_ptr transit=
ion:

Step 1:  Introduce bit_vector (or whatever) and deprecate the vector&lt;boo=
l&gt; specialization.  /Somehow/ motivate people to migrate.</pre>
              </blockquote>
            </div>
            I think that we will need also to add a std::<b>new_</b>vector&=
lt;T&gt;


            that behaves like std::vector&lt;T&gt; but doesn't have the
            bool specialization and <b>deprecate</b> std::vector :-&gt;<br>
          </div>
        </blockquote>
        <div><br>
          -100.<br>
          <br>
          * Annoying 99% of all C++ users is a horrible, horrible idea.<br>
        </div>
      </div>
    </blockquote>
    Right. Forget the last sentence.<br>
    <blockquote
cite=3D"mid:CAGg_6+OS21ww71D-94NO0f0pLUDo6fGUULdZ6KkVc0aypwf_uw@mail.gmail.=
com"
      type=3D"cite">
      <div class=3D"gmail_quote">
        <div><br>
          * I'd hate to use a code base that had two different,
          unrelated types for doing the exact same thing, since
          ultimately these things end up interfaces.&nbsp; Actually, I
          already have that, as people are trying to migrate from Boost
          over to std (such as shared_ptr), and it is anything but easy
          (because we are dependent on libraries developed for/by other
          groups, and changing those interfaces is a scheduling
          nightmare).<br>
        </div>
      </div>
    </blockquote>
    You are right. What we would need is 'single' type that behaves as
    the current vector&lt;T&gt; except for bool and that behaves as
    vector&lt;bool&gt; if vector was not specialized. I don't know if we
    can specialize an alias and if the following is correct<br>
    <br>
    template &lt;typename T, typename Allocator&gt;<br>
    class new_vector { the same definition as vector&lt;T, Allocator&gt;
    now };<br>
    <br>
    template &lt;typename T, typename Allocator&gt;<br>
    alias vector=3D new_vector&lt;T, Allocator&gt; ;<br>
    <br>
    template &lt; typename Allocator&gt;<br>
    class vector&lt;bool, Allocator&gt; { the same definition as now } ;<br=
>
    <br>
    If this is correct, users of vector would get the same behavior.
    Users of new_vector would get the behavior without the bool
    specialization.<br>
    Any function expecting a vector&lt;T&gt; work with
    new_vector&lt;T&gt; except for bool. The same is valid for function
    expecting new_vector&lt;T&gt; you can use it with vector&lt;T&gt;
    except for bool.<br>
    <br>
    Of course we need a bit_vector class that replace the
    vector&lt;bool&gt; specialization as Howard suggested.<br>
    After the deprecation period, new_vector and vector would have the
    same behavior and new_vector could be deprecated at his turn. <br>
    <br>
    <br>
    Vicente<br>
  </body>
</html>

<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 />

--------------030901000709050908050009--

.
