220 31028 <06e829ca-417b-470c-95ca-c661e8752f79@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: ricky.65@hotmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: compressed std::bitset<N>
Date: Tue, 21 Feb 2017 12:40:00 -0800 (PST)
Lines: 111
Approved: news@gmane.org
Message-ID: <06e829ca-417b-470c-95ca-c661e8752f79@isocpp.org>
References: <32cfea0a-7df8-47cf-47fd-549985f12295@wanadoo.fr>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1587_1044681994.1487709600699"
X-Trace: blaine.gmane.org 1487709604 13695 195.159.176.226 (21 Feb 2017 20:40:04 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 21 Feb 2017 20:40:04 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDIITWUOTQNRBIOLWLCQKGQEULVANDI@isocpp.org Tue Feb 21 21:39:58 2017
Return-path: <std-proposals+bncBDIITWUOTQNRBIOLWLCQKGQEULVANDI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qt0-f197.google.com ([209.85.216.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDIITWUOTQNRBIOLWLCQKGQEULVANDI@isocpp.org>)
	id 1cgHE5-0002zR-NB
	for gclcip-std-proposals@m.gmane.org; Tue, 21 Feb 2017 21:39:57 +0100
Original-Received: by mail-qt0-f197.google.com with SMTP id n37sf12042525qtb.7
        for <gclcip-std-proposals@m.gmane.org>; Tue, 21 Feb 2017 12:40:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=8ipSiyannu+9Tdy8VGbX5SXuzqsQbjpXUVnwE5gEh1o=;
        b=qnqpnE+GXPdqsJul10oBZ1o/GICGzJA+JXXA7D8ZE9Ooe5rg7h6q3YIfLq9TzP0rfg
         Clk2gPiPef+DwYWWtHU+3q948BdMbdn/CanpmHwYBoW5oFNAQosrQ9nGVG/trGe0q+6J
         7gC8qv4up7gXIAQiciP1kmRqpGU3irv2SCDM8okaGLgSJTarXB9UbgEelmGoayjiu1bW
         vb0wGQXxkCvftYGLbBolGDaaY26vYN4vyiFXyFHpPH4W7Vmq79YJXbRe04wp4S0z70DV
         nZEwrOZZj3zBr35UwAgt5W8NaQS3TkjbUT6yyBMg0z7LPPx+yZEJ80ro6ZoiNTll7QxR
         VN2A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        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:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=8ipSiyannu+9Tdy8VGbX5SXuzqsQbjpXUVnwE5gEh1o=;
        b=WXqJ3M5/yxy2FNXPxiCw6NfK51k+DGBoGyXYe6qXH6nSnybcOXuokTmht0p9JoioQR
         xB4wUSk3WW7Wg01shy/lzPAzuoXi1vldl+afv3fKef9E5D4hPHr44ettXBIfHAMoUaVi
         KmFX6XjrNSoD8DQXGQ/yTVgmwdOzRz3CQzm//EJJliSRtrawP23Lq2uDyNn4s6fcjRRd
         kK7RGH73EXjrFyRHiQkRn5pCY6zaMIpYRLXNqm1n7MOunn1y7QQ3EnCLxP2MFnwBzg6Y
         puNUx8x3ViLXk//KOfuupLXNVYXVq3AXf86UsiL8Fxu1u1PKlJJBmdw7loX2T1QkJxoa
         yQYQ==
X-Gm-Message-State: AMke39nkh1AlBVp7wCB5ZZ+YkinyweQzyphXoIgt8ieIXxDxJF4oUmKjMBwVSdsOq1zGKA==
X-Received: by 10.200.1.6 with SMTP id e6mr1836514qtg.54.1487709602563;
        Tue, 21 Feb 2017 12:40:02 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.12.97 with SMTP id 88ls12891312otr.34.gmail; Tue, 21 Feb
 2017 12:40:01 -0800 (PST)
X-Received: by 10.157.17.114 with SMTP id p47mr1886800otp.6.1487709601179;
        Tue, 21 Feb 2017 12:40:01 -0800 (PST)
In-Reply-To: <32cfea0a-7df8-47cf-47fd-549985f12295@wanadoo.fr>
X-Original-Sender: ricky.65@hotmail.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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:31028
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31028>

------=_Part_1587_1044681994.1487709600699
Content-Type: multipart/alternative; 
	boundary="----=_Part_1588_279372894.1487709600700"

------=_Part_1588_279372894.1487709600700
Content-Type: text/plain; charset=UTF-8

Hi Vicente,

I think the Bitset2 <https://github.com/ClaasBontus/bitset2>library by 
Claas Bontus provides what you are looking for. It's like std::bitset but 
with enhanced functionality. It let's you set the underlying integral type 
of the bitset. In fact, it defaults to uint8_t, uint16_t, or uint32_t if N bits 
fit into those integers. I would like this functionality added to 
std::bitset but, as you said, it would probably be a breaking change.

Riccardo

On Thursday, February 16, 2017 at 7:04:53 AM UTC, Vicente J. Botet Escriba 
wrote:
>
> Hi,
>
> I wanted to use bitset<8>, bitset<16>, bitset<32> to represent the mask 
> of 8,16 and 32 bits respectively but the sizeof them is 64 bits on the  
> systems I've tested.
>
> Wondering if others have suffered already of this situation. 
>
> How do you fill about adding a constraint on the implementation, so that 
> the sizeof shall be respectively 8, 16, 32 bits.
>
> If this is not backward compatible, would it be worth to define a 
> different type?
>
>
> Vicente
>

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/06e829ca-417b-470c-95ca-c661e8752f79%40isocpp.org.

------=_Part_1588_279372894.1487709600700
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Vicente,<div><br></div><div><font size=3D"2" face=3D"ar=
ial, sans-serif">I think the <a href=3D"https://github.com/ClaasBontus/bits=
et2">Bitset2 </a>library by Claas Bontus provides what you are looking for.=
 It&#39;s like std::bitset but with enhanced functionality. It let&#39;s yo=
u set the underlying integral type of the bitset. In fact, it=C2=A0<span st=
yle=3D"color: rgb(51, 51, 51);">defaults to uint8_t, uint16_t, or uint32_t=
=C2=A0</span><span style=3D"color: rgb(51, 51, 51);">if N</span><span style=
=3D"color: rgb(51, 51, 51);">=C2=A0bits fit into those integers.</span>=C2=
=A0I would like this functionality added to std::bitset but, as you said, i=
t would probably be a breaking change.</font></div><div><br></div><div>Ricc=
ardo<br><br>On Thursday, February 16, 2017 at 7:04:53 AM UTC, Vicente J. Bo=
tet Escriba wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;marg=
in-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
 =20

   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    <p><font size=3D"+1">Hi,</font></p>
    <p><font size=3D"+1">I wanted to use bitset&lt;8&gt;,</font><font size=
=3D"+1"> bitset&lt;16&gt;,</font><font size=3D"+1">
        bitset&lt;32&gt; to represent the mask of 8,16 and 32 bits
        respectively but the sizeof them is 64 bits on the=C2=A0 systems I&=
#39;ve
        tested.</font></p>
    <p><font size=3D"+1">Wondering if others have suffered already of this
        situation. <br>
      </font></p>
    <p><font size=3D"+1">How do you fill about adding a constraint on the
        implementation, so that the sizeof shall be respectively 8, 16,
        32 bits.</font></p>
    <p><font size=3D"+1">If this is not backward compatible, would it be
        worth to define a different type?<br>
      </font></p>
    <p><font size=3D"+1"><br>
      </font></p>
    <p><font size=3D"+1">Vicente<br>
      </font></p>
  </div>

</blockquote></div></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/06e829ca-417b-470c-95ca-c661e8752f79%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/06e829ca-417b-470c-95ca-c661e8752f79=
%40isocpp.org</a>.<br />

------=_Part_1588_279372894.1487709600700--

------=_Part_1587_1044681994.1487709600699--

.
