220 4703 <68BF59D5-2323-4F67-9D69-E5FE04E90065@gmail.com> article
Path: news.gmane.org!not-for-mail
From: Howard Hinnant <howard.hinnant@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Remove vector<bool>?
Date: Wed, 29 May 2013 10:32:27 -0400
Lines: 52
Approved: news@gmane.org
Message-ID: <68BF59D5-2323-4F67-9D69-E5FE04E90065@gmail.com>
References: <CAGsORuDQdeWAO5yjA6=h0hW9Y0Sj4F1gcHB61udw5JFmtx+g4Q@mail.gmail.com> <CAGg_6+O9XJucMxwEhU+50Dzx0Tz7XRK0cWyrkUHuPSoEz9TqEw@mail.gmail.com> <DBDB593B-7988-4A2E-AD88-0B5D37D136FD@gmail.com> <380926f6-352d-43d4-9295-535aeea1d242@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\))
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1369837952 9928 80.91.229.3 (29 May 2013 14:32:32 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 29 May 2013 14:32:32 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCK2HM4L6YERB7VCTCGQKGQE63BCPBA@isocpp.org Wed May 29 16:32:33 2013
Return-path: <std-proposals+bncBCK2HM4L6YERB7VCTCGQKGQE63BCPBA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oa0-f72.google.com ([209.85.219.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCK2HM4L6YERB7VCTCGQKGQE63BCPBA@isocpp.org>)
	id 1UhhQW-0006CY-3s
	for gclcip-std-proposals@m.gmane.org; Wed, 29 May 2013 16:32:32 +0200
Original-Received: by mail-oa0-f72.google.com with SMTP id h1sf48002273oag.11
        for <gclcip-std-proposals@m.gmane.org>; Wed, 29 May 2013 07:32:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere:mime-version:subject:from:in-reply-to:date:message-id
         :references:to:x-mailer: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
         :content-transfer-encoding;
        bh=urn05l+qUcAVk8s5CikR3hp8/hJTw/H5pdncnOVhGoc=;
        b=bWZmezLujP8yn2KT8W9NaLJN5Wi2IDCh3vKxsMGr1jyL6ouN7vLthixC8KTroT2dAz
         GCtLOaUtVXa19RwobC14DgGkDWo0foAdLSVWGPUXCb/QaoXG5c4uMMjPORimucKSXFuz
         1a/Q+HnQ0svtmIR+cr7Chn4vuyH0UfpiD/mC/+x8MJJFtw85h745tEC78QXX4uMNam1G
         Jrlhr/VzO26EwL5EMshJBG4SAg0JvRvOyylIuFZ2K6sZSjKGbxwLauWDidZcOR18xqKt
         b2Z89Unuovzgtn/Ws6jcoxIZUO00SSjnugoAITtu2icTLhMchHjIMYVEizjyGGA1tmG7
   
X-Received: by 10.182.240.37 with SMTP id vx5mr770682obc.12.1369837950936;
        Wed, 29 May 2013 07:32:30 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.243.166 with SMTP id wz6ls1368239obc.19.gmail; Wed, 29 May
 2013 07:32:30 -0700 (PDT)
X-Received: by 10.60.37.133 with SMTP id y5mr1742899oej.123.1369837949962;
        Wed, 29 May 2013 07:32:29 -0700 (PDT)
Original-Received: from mail-ie0-x22a.google.com (mail-ie0-x22a.google.com [2607:f8b0:4001:c03::22a])
        by mx.google.com with ESMTPS id w3si115576obz.132.2013.05.29.07.32.29
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 29 May 2013 07:32:29 -0700 (PDT)
Received-SPF: pass (google.com: domain of howard.hinnant@gmail.com designates 2607:f8b0:4001:c03::22a as permitted sender) client-ip=2607:f8b0:4001:c03::22a;
Original-Received: by mail-ie0-f170.google.com with SMTP id e14so6632225iej.1
        for <std-proposals@isocpp.org>; Wed, 29 May 2013 07:32:29 -0700 (PDT)
X-Received: by 10.42.26.12 with SMTP id d12mr1206288icc.1.1369837949618;
        Wed, 29 May 2013 07:32:29 -0700 (PDT)
Original-Received: from [10.0.1.4] (cpe-24-59-186-27.twcny.res.rr.com. [24.59.186.27])
        by mx.google.com with ESMTPSA id ik6sm2515008igb.3.2013.05.29.07.32.26
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Wed, 29 May 2013 07:32:27 -0700 (PDT)
In-Reply-To: <380926f6-352d-43d4-9295-535aeea1d242@isocpp.org>
X-Mailer: Apple Mail (2.1503)
X-Original-Sender: howard.hinnant@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of howard.hinnant@gmail.com designates 2607:f8b0:4001:c03::22a as
 permitted sender) smtp.mail=howard.hinnant@gmail.com;       dkim=pass header.i=@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:4703
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4703>


On May 29, 2013, at 6:16 AM, cornedbee@google.com wrote:

>=20
>=20
> On Tuesday, May 28, 2013 6:43:36 PM UTC+2, Howard Hinnant wrote:
>=20
>> I will oppose deprecating vector<bool> until we put in place something f=
or clients of vector<bool> to migrate to.  That something should have much =
the same API as vector<bool> to ease said migration.  I.e. clients of vecto=
r<bool> should have to do little more than change the name of the container=
..=20
>>=20
>> Additionally we could add sweetener to encourage the migration.  For exa=
mple we could mandate that bit_vector<Allocator> (or whatever the new name =
is) is hyper efficient when used with std::algorithms such as:=20
>>=20
>=20
> And we should add an interface that allows 3rd-party or user-defined algo=
rithms to exploit the packed representation of bit_vector. It's all nice fo=
r standard algorithms to be optimized for vector<bool>, but as a user of th=
e library, I can't optimize my own algorithms without reaching into the imp=
lementation details, such as __bit_reference. So not only would I have to o=
ptimize my algorithm for packed bits, I'd have to do it for many different =
standard libraries.

I like this direction.  And standardizing count-lead/trailing-zero-bits and=
 population-count algorithms would help in this department too.

http://en.wikipedia.org/wiki/Count_leading_zeros#Hardware_support
http://en.wikipedia.org/wiki/Hamming_weight#Processor_support

C started out as a "portable assembly", but except for the recent atomic ad=
ditions, hasn't kept up with additions to the popular set of machine instru=
ctions.  Instead non-portable compiler intrinsics have risen to fill the ga=
p.  C++ should give us portable access to those compiler intrinsics.

Howard

--=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.



.
