220 19934 <CA0E9B7F-7FDA-42FC-89BA-4A6C4C5FE3B2@mac.com> article
Path: news.gmane.org!not-for-mail
From: David Krauss <potswa@mac.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: `std::bitset::contains(const std::bitset&)`
Date: Thu, 20 Aug 2015 07:48:58 +0800
Lines: 80
Approved: news@gmane.org
Message-ID: <CA0E9B7F-7FDA-42FC-89BA-4A6C4C5FE3B2@mac.com>
References: <e3a46f13-7d1d-4d9a-b530-4eb2be725b0b@isocpp.org>
 <db9b5d87-87a2-46ba-be90-099f62167e8d@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\))
Content-Type: multipart/alternative;
 boundary="Apple-Mail=_029CDFBB-BED5-4B2E-AE75-885028852EF4"
X-Trace: ger.gmane.org 1440028175 1819 80.91.229.3 (19 Aug 2015 23:49:35 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 19 Aug 2015 23:49:35 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBAABB4VL2SXAKGQE4Z4A56Q@isocpp.org Thu Aug 20 01:49:26 2015
Return-path: <std-proposals+bncBAABB4VL2SXAKGQE4Z4A56Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pd0-f200.google.com ([209.85.192.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBAABB4VL2SXAKGQE4Z4A56Q@isocpp.org>)
	id 1ZSD6X-0004ZH-Cn
	for gclcip-std-proposals@m.gmane.org; Thu, 20 Aug 2015 01:49:13 +0200
Original-Received: by pdbnh15 with SMTP id nh15sf36056771pdb.1
        for <gclcip-std-proposals@m.gmane.org>; Wed, 19 Aug 2015 16:49:07 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:content-type:message-id:mime-version
         :subject:date:references:to:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=G6c+QmyGSejF1M9VuSSBrI9sXZ31Rbvyu3eWAzsr+mU=;
        b=L6akZCRm+PZByo+ieri5fxoykrFJaLNA2VgF1dt/1T82jW9RhK1cacGz6KEGJ6b8VK
         boemOQqqiaQ2hibg6GChBA0VOpGyp09gOxOA+pnFPA0kMvUrXQ1q0m8qtCxXnNiVYgLs
         oMUrahrDKa/KnPoHfQk09JnYErLStHgzU9UAnXVD3tbLof1dGgIcBay6DRwCRJcx8Oql
         llIXM9fuOJM9H9OFkekz5ecLVysFlO+GsVJ4K18DiGsqsnr5Hfsu5cTVSphfEY57MLOP
         vaXEd+kI0+nSDh24eHDqSVYRLpEeoLPKTeHiZUDUC+jsfyYwBGwOnMyTWcGZZeFFuWjZ
         CqIg==
X-Gm-Message-State: ALoCoQlRusg9/Kf67LzAZXC0wo4jyiV7q/YnhAsCc5VRXj7tK4hPQZ74sOVu64tLzeFIF54CVi2l
X-Received: by 10.66.240.138 with SMTP id wa10mr86544pac.43.1440028147186;
        Wed, 19 Aug 2015 16:49:07 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.90.179 with SMTP id bx19ls39276igb.1.gmail; Wed, 19 Aug
 2015 16:49:06 -0700 (PDT)
X-Received: by 10.70.140.238 with SMTP id rj14mr384230pdb.38.1440028146060;
        Wed, 19 Aug 2015 16:49:06 -0700 (PDT)
Original-Received: from pv33p04im-asmtp001.me.com (pv33p04im-asmtp001.me.com. [17.143.181.10])
        by mx.google.com with ESMTPS id ni8si4170693pbc.47.2015.08.19.16.49.06
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=AES128-GCM-SHA256 bits=128/128);
        Wed, 19 Aug 2015 16:49:06 -0700 (PDT)
Received-SPF: pass (google.com: domain of potswa@mac.com designates 17.143.181.10 as permitted sender) client-ip=17.143.181.10;
Original-Received: from [172.20.10.2] (unknown [121.54.44.88])
 by pv33p04im-asmtp001.me.com
 (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Mar 31 2015))
 with ESMTPSA id <0NTC00CCQSTMA710@pv33p04im-asmtp001.me.com> for
 std-proposals@isocpp.org; Wed, 19 Aug 2015 23:49:04 +0000 (GMT)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,,
 definitions=2015-08-20_01:,, signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
 suspectscore=1 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0
 reason=mlx scancount=1 engine=8.0.1-1412110000 definitions=main-1508190361
In-reply-to: <db9b5d87-87a2-46ba-be90-099f62167e8d@isocpp.org>
X-Mailer: Apple Mail (2.2098)
X-Original-Sender: potswa@mac.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of potswa@mac.com designates 17.143.181.10 as permitted sender)
 smtp.mailfrom=potswa@mac.com;       dmarc=pass (p=NONE dis=NONE) header.from=mac.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:19934
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/19934>

--Apple-Mail=_029CDFBB-BED5-4B2E-AE75-885028852EF4
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9308=E2=80=9320, at 5:10 AM, rhalbersma@gmail.com wrote:
>=20
> However, adding those members would only solve this particular problem. I=
t would be much more convenient if std::bitset would mimic std::vector and =
expose a data() pointer to its unsigned integer blocks. This would allow e.=
g. library writers to provide expression templates that facilitate loop fus=
ion and eliminate temporaries in multi-term bit-twiddling expressions for b=
itsets with more than 64-bits.=20

The expression (a & b).any() already optimized perfectly: http://goo.gl/Gnd=
tKj <http://goo.gl/GndtKj> (godbolt.org)

Implementations have latitude to use underlying types smaller than unsigned=
 long, so the return type of data() would be implementation-dependent. Prob=
ably its bit ordering, too.

--=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/.

--Apple-Mail=_029CDFBB-BED5-4B2E-AE75-885028852EF4
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D""><br class=3D""><di=
v><blockquote type=3D"cite" class=3D""><div class=3D"">On 2015=E2=80=9308=
=E2=80=9320, at 5:10 AM, <a href=3D"mailto:rhalbersma@gmail.com" class=3D""=
>rhalbersma@gmail.com</a> wrote:</div><br class=3D"Apple-interchange-newlin=
e"><div class=3D""><span style=3D"font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant: normal; font-weight: normal; letter-spaci=
ng: normal; line-height: normal; orphans: auto; text-align: start; text-ind=
ent: 0px; text-transform: none; white-space: normal; widows: auto; word-spa=
cing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !im=
portant;" class=3D"">However, adding those members would only solve this pa=
rticular problem. It would be much more convenient if std::bitset would mim=
ic std::vector and expose a data() pointer to its unsigned integer blocks. =
This would allow e.g. library writers to provide expression templates that =
facilitate loop fusion and eliminate temporaries in multi-term bit-twiddlin=
g expressions for bitsets with more than 64-bits.&nbsp;</span></div></block=
quote></div><br class=3D""><div class=3D"">The expression <font face=3D"Cou=
rier" class=3D"">(a &amp; b).any()</font>&nbsp;already optimized perfectly:=
&nbsp;<a href=3D"http://goo.gl/GndtKj" class=3D"">http://goo.gl/GndtKj</a>&=
nbsp;(<a href=3D"http://godbolt.org" class=3D"">godbolt.org</a>)</div><div =
class=3D""><br class=3D""></div><div class=3D"">Implementations have latitu=
de to use underlying types smaller than unsigned long, so the return type o=
f <font face=3D"Courier" class=3D"">data()</font> would be implementation-d=
ependent. Probably its bit ordering, too.</div></body></html>

<p></p>

-- <br />
<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 <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_029CDFBB-BED5-4B2E-AE75-885028852EF4--

.
