220 13427 <41983d24-efb2-4255-b09b-f84cff7bf56d@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Matthew Fioravante <fmatthew5876@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Proposal: Strongly Typed Bitset
Date: Wed, 1 Oct 2014 08:03:14 -0700 (PDT)
Lines: 120
Approved: news@gmane.org
Message-ID: <41983d24-efb2-4255-b09b-f84cff7bf56d@isocpp.org>
References: <f77c8cc7-64f6-4d3b-9a10-8a5ee5f2254d@isocpp.org> <113390b2-9c74-47e2-a943-5d27dd48bdf1@isocpp.org>
 <CAGg_6+P+Hsq_stLp4+CTyK3ezvOvCAyCy7hBu+ZqSbJMfJHQ8w@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_20_1582199149.1412175794805"
X-Trace: ger.gmane.org 1412175806 4351 80.91.229.3 (1 Oct 2014 15:03:26 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 1 Oct 2014 15:03:26 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDELF54RTIGRBNFPWCQQKGQEQIV4EJQ@isocpp.org Wed Oct 01 17:03:20 2014
Return-path: <std-proposals+bncBDELF54RTIGRBNFPWCQQKGQEQIV4EJQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oi0-f69.google.com ([209.85.218.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDELF54RTIGRBNFPWCQQKGQEQIV4EJQ@isocpp.org>)
	id 1XZLQz-0006TW-UU
	for gclcip-std-proposals@m.gmane.org; Wed, 01 Oct 2014 17:03:18 +0200
Original-Received: by mail-oi0-f69.google.com with SMTP id u20sf4472333oif.8
        for <gclcip-std-proposals@m.gmane.org>; Wed, 01 Oct 2014 08:03:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type;
        bh=/u0xaSfQ0Dqa182XMqWIuFGYd6vB+Ai+g9VPf28tPlQ=;
        b=wqTGwJ9cRqGQWGG5H4Z8VonJXPxLDxE3iiLznf7/DytnSRgPTxTpEbpixx+Cb2d36s
         3Vfvn5xLMkAWnXQJ4F1KUfr5U99I5+YDqnteSOtU6Ap8xBDM8ng9Awkq+ZKdWlWpa3+Y
         9ahQpGMpag222GA9s7rjkiOgTcn3r33lJy5vyb8M7WqUYf4Qi9uJ7R4RB0r9CntfB+GQ
         L2hvOgsqYb8dEs3SJXKhJ8EPDJkYgj2DmV7EHLIFbqHyFrTu3QRFQRz2Sow4yXzbo5MV
         e1V8ZgcyV/2VMxu4COgdMpr96NisNedHR+r1QLzQ1vstBLQcs6+fwqV4pWxPz86XxMjN
         Nznw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=/u0xaSfQ0Dqa182XMqWIuFGYd6vB+Ai+g9VPf28tPlQ=;
        b=QRsiCuWjinUq7eFsC2GuZhyQ2ad2rtTpD/DaZ6G4IAKFN79585Ahmg7q8LhoytJ95P
         g1WI3Cyr/LlC5jDYQHaHZlNcoDmZGKoEZVys+i9GorMVfFVa0cfqaQ+25KsbMDPD9v0v
         NTp84Cv/0wxrGCQfSKxagP6/ja/+rii8JZDh8RTnxcxs/p/IGddqFIBp/6bJK7MEU60T
         OnN9r1wcm6T1o78xbpaWrjTkraoPKw27zZdehN09foDlBYpSrISebCx0ljDXBjaMiGs9
         gJRYPz6c5oKb/EaJumt8OE/66Rh6Ik/meI/t8a6a3iayDuuGsgsLQFYTf3Wh9R8xtWgp
         d0gw==
X-Gm-Message-State: ALoCoQkaI4Z3KTukPy47H/0WNn9VYHVArhdCiWWn4L9Q5MzNsdVs4lezvlTN40GVkfj0L1+5eNH+
X-Received: by 10.182.199.4 with SMTP id jg4mr46271198obc.43.1412175796961;
        Wed, 01 Oct 2014 08:03:16 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.81.82 with SMTP id e76ls431726qgd.87.gmail; Wed, 01 Oct
 2014 08:03:16 -0700 (PDT)
X-Received: by 10.140.107.71 with SMTP id g65mr3992qgf.39.1412175796186;
        Wed, 01 Oct 2014 08:03:16 -0700 (PDT)
In-Reply-To: <CAGg_6+P+Hsq_stLp4+CTyK3ezvOvCAyCy7hBu+ZqSbJMfJHQ8w@mail.gmail.com>
X-Original-Sender: fmatthew5876@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>, <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:13427
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/13427>

------=_Part_20_1582199149.1412175794805
Content-Type: text/plain; charset=UTF-8



On Wednesday, October 1, 2014 10:27:58 AM UTC-4, Nevin ":-)" Liber wrote:
>
> On 1 October 2014 08:17, <rick...@hotmail.com <javascript:>> wrote:
>
>> However, I am dubious about the implementator guide of optimizing for 
>> speed over size. In contrast, some may prefer to optimize for size over 
>> speed.
>>
>
> We really should have *two* different types (or possibly yet another 
> template parameter) to address this...
>

A separate type would be better:

template <typename N> using fast_bitset = bitset<N, /* Implementation 
defined */>
template <typename N> using small_bitset = bitset<N, /* Implementation 
defined */>

The small variant is somewhat ambiguous. Does it only optimize for size or 
also alignment? If it's the second one, then we probably end up with 
bitset<N,uint8_t> which likely performs the worst. Maybe we only need a 
fast_bitset and let the users optimize for size themselves.



-- 

--- 
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/.

------=_Part_20_1582199149.1412175794805
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, October 1, 2014 10:27:58 AM UTC-4, N=
evin ":-)" Liber wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0=
;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div di=
r=3D"ltr"><div>On 1 October 2014 08:17,  <span dir=3D"ltr">&lt;<a href=3D"j=
avascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"ISatF23ywSkJ" onmous=
edown=3D"this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'ja=
vascript:';return true;">rick...@hotmail.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>However, I am dub=
ious about the implementator guide of optimizing for speed over size.&nbsp;=
<span style=3D"font-size:11.0pt;line-height:115%;font-family:&quot;Calibri&=
quot;,&quot;sans-serif&quot;">In contrast</span>, some may prefer to optimi=
ze for size over speed.</div><div></div></blockquote></div><br>We really sh=
ould have *two* different types (or possibly yet another template parameter=
) to address this...<br></div></div></blockquote><div><br>A separate type w=
ould be better:<br><br><div class=3D"prettyprint" style=3D"background-color=
: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid=
; border-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><d=
iv class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by=
-prettify">template</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
&lt;</span><span style=3D"color: #008;" class=3D"styled-by-prettify">typena=
me</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> N</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D=
"color: #008;" class=3D"styled-by-prettify">using</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> fast_bitset </span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> bitset</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">N</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </span><span style=3D"color: #800;" class=3D"styled-by-prettify">/=
* Implementation defined */</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">template</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</=
span><span style=3D"color: #008;" class=3D"styled-by-prettify">typename</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> N</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">using</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> small_bitset </span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> bitset</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify">N</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #800;" class=3D"styled-by-prettify">/* Imp=
lementation defined */</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"><br></span></div></code></div><br>The small variant is somewhat ambig=
uous. Does it only optimize for size or also alignment? If it's the second =
one, then we probably end up with bitset&lt;N,uint8_t&gt; which likely perf=
orms the worst. Maybe we only need a fast_bitset and let the users optimize=
 for size themselves.<br><br><br><br></div></div>

<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 />

------=_Part_20_1582199149.1412175794805--

.
