Topic: std::bitset_size<T>


Author: Vittorio Romeo <vittorio.romeo.vee@gmail.com>
Date: Sun, 9 Aug 2015 07:07:04 -0700 (PDT)
Raw View
------=_Part_184_60247207.1439129224917
Content-Type: multipart/alternative;
 boundary="----=_Part_185_1946685691.1439129224917"

------=_Part_185_1946685691.1439129224917
Content-Type: text/plain; charset=UTF-8

Is any proposal already there to add a compile-time way of obtaining the
size of an std::bitset?

Example:
using MyBitset = std::bitset<128>;
static_assert(std::bitset_size<MyBitset>{} == 128, "");

Possible implementation:
template<typename T>
struct bitset_size;

template<std::size_t N>
struct bitset_size<std::bitset<N>> final
    : std::integral_constant<std::size_t, N>
{

};

If there's no such proposal, and everyone is fine with this idea, I would
be happy to write and submit one.

--

---
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_185_1946685691.1439129224917
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Is any proposal already there to add a compile-time way of=
 obtaining the size of an std::bitset?<br><div><br></div><div>Example:</div=
><div><div class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 1=
87); word-wrap: break-word; background-color: rgb(250, 250, 250);"><code cl=
ass=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #00=
8;" class=3D"styled-by-prettify">using</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"s=
tyled-by-prettify">MyBitset</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> std</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</s=
pan><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: #066;" class=3D"styled-by-prettify">128</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><font color=3D"#0=
00000"><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span st=
yle=3D"color: #008;" class=3D"styled-by-prettify">static_assert</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify">std</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify">bitset_size</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #606;" class=
=3D"styled-by-prettify">MyBitset</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: #660;" class=3D"styled-by=
-prettify">=3D=3D</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">12=
8</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span styl=
e=3D"color: #080;" class=3D"styled-by-prettify">&quot;&quot;</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">);</span></font></div></c=
ode></div><br></div><div>Possible implementation:</div><div><div class=3D"p=
rettyprint" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break=
-word; background-color: rgb(250, 250, 250);"><code class=3D"prettyprint"><=
div class=3D"subprettyprint"><font color=3D"#660066"><div class=3D"subprett=
yprint">template&lt;typename T&gt;</div><div class=3D"subprettyprint">struc=
t bitset_size;</div><div class=3D"subprettyprint"><br></div><div class=3D"s=
ubprettyprint">template&lt;std::size_t N&gt;=C2=A0</div><div class=3D"subpr=
ettyprint">struct bitset_size&lt;std::bitset&lt;N&gt;&gt; final</div><div c=
lass=3D"subprettyprint">=C2=A0 =C2=A0 : std::integral_constant&lt;std::size=
_t, N&gt;=C2=A0</div><div class=3D"subprettyprint">{=C2=A0</div><div class=
=3D"subprettyprint"><br></div><div class=3D"subprettyprint">};</div></font>=
</div></code></div><br>If there&#39;s no such proposal, and everyone is fin=
e with this idea, I would be happy to write and submit one.</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_185_1946685691.1439129224917--
------=_Part_184_60247207.1439129224917--

.


Author: Alisdair Meredith <alisdairm@me.com>
Date: Sun, 09 Aug 2015 10:20:01 -0400
Raw View
--Apple-Mail=_92386EFB-E7D2-4BC3-B9AA-BD3236E035F3
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8

'constexpr size_t std::bitset<N>::size() const noexcept=E2=80=99 may be wha=
t you are looking for?

The main problem with this function is that it is a non-static member funct=
ion, so you need
an actual bitset object to use it.

AlisdairM

> On Aug 9, 2015, at 10:07 AM, Vittorio Romeo <vittorio.romeo.vee@gmail.com=
> wrote:
>=20
> Is any proposal already there to add a compile-time way of obtaining the =
size of an std::bitset?
>=20
> Example:
> using MyBitset =3D std::bitset<128>;
> static_assert(std::bitset_size<MyBitset>{} =3D=3D 128, "");
>=20
> Possible implementation:
> template<typename T>
> struct bitset_size;
>=20
> template<std::size_t N>=20
> struct bitset_size<std::bitset<N>> final
>     : std::integral_constant<std::size_t, N>=20
> {=20
>=20
> };
>=20
> If there's no such proposal, and everyone is fine with this idea, I would=
 be happy to write and submit one.
>=20
> --=20
>=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=
 email to std-proposals+unsubscribe@isocpp.org <mailto:std-proposals+unsubs=
cribe@isocpp.org>.
> To post to this group, send email to std-proposals@isocpp.org <mailto:std=
-proposals@isocpp.org>.
> Visit this group at http://groups.google.com/a/isocpp.org/group/std-propo=
sals/ <http://groups.google.com/a/isocpp.org/group/std-proposals/>.

--=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=_92386EFB-E7D2-4BC3-B9AA-BD3236E035F3
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"">'constexpr size_t =
std::bitset&lt;N&gt;::size() const noexcept=E2=80=99 may be what you are lo=
oking for?<div class=3D""><br class=3D""></div><div class=3D"">The main pro=
blem with this function is that it is a non-static member function, so you =
need</div><div class=3D"">an actual bitset object to use it.</div><div clas=
s=3D""><br class=3D""></div><div class=3D"">AlisdairM<br class=3D""><div cl=
ass=3D""><br class=3D""><div><blockquote type=3D"cite" class=3D""><div clas=
s=3D"">On Aug 9, 2015, at 10:07 AM, Vittorio Romeo &lt;<a href=3D"mailto:vi=
ttorio.romeo.vee@gmail.com" class=3D"">vittorio.romeo.vee@gmail.com</a>&gt;=
 wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><div d=
ir=3D"ltr" class=3D"">Is any proposal already there to add a compile-time w=
ay of obtaining the size of an std::bitset?<br class=3D""><div class=3D""><=
br class=3D""></div><div class=3D"">Example:</div><div class=3D""><div clas=
s=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); word-wrap:=
 break-word; background-color: rgb(250, 250, 250);"><code class=3D"prettypr=
int"><span style=3D"color: #008;" class=3D"styled-by-prettify">using</span>=
 <span style=3D"color: #606;" class=3D"styled-by-prettify">MyBitset</span> =
<span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span> std<sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">::</span>bitset<span=
 style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">128</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">&gt;</span><font class=3D""><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D""=
 class=3D"styled-by-prettify"><br class=3D""></span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">static_assert</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">(</span><span style=3D"" class=3D"sty=
led-by-prettify">std</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">::</span><span style=3D"" class=3D"styled-by-prettify">bitset_siz=
e</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</spa=
n><span style=3D"color: #606;" class=3D"styled-by-prettify">MyBitset</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;{}</span><spa=
n style=3D"" class=3D"styled-by-prettify"> </span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">=3D=3D</span><span style=3D"" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-pr=
ettify">128</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>,</span><span style=3D"" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">""</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">);</span></font></code></div><br cla=
ss=3D""></div><div class=3D"">Possible implementation:</div><div class=3D""=
><div class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 187, 187); =
word-wrap: break-word; background-color: rgb(250, 250, 250);"><code class=
=3D"prettyprint"><div class=3D"subprettyprint"><font color=3D"#660066" clas=
s=3D""><div class=3D"subprettyprint">template&lt;typename T&gt;</div><div c=
lass=3D"subprettyprint">struct bitset_size;</div><div class=3D"subprettypri=
nt"><br class=3D""></div><div class=3D"subprettyprint">template&lt;std::siz=
e_t N&gt;&nbsp;</div><div class=3D"subprettyprint">struct bitset_size&lt;st=
d::bitset&lt;N&gt;&gt; final</div><div class=3D"subprettyprint">&nbsp; &nbs=
p; : std::integral_constant&lt;std::size_t, N&gt;&nbsp;</div><div class=3D"=
subprettyprint">{&nbsp;</div><div class=3D"subprettyprint"><br class=3D""><=
/div><div class=3D"subprettyprint">};</div></font></div></code></div><br cl=
ass=3D"">If there's no such proposal, and everyone is fine with this idea, =
I would be happy to write and submit one.</div></div><div class=3D""><br cl=
ass=3D"webkit-block-placeholder"></div>

-- <br class=3D"">
<br class=3D"">
--- <br class=3D"">
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.<br class=3D"">
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" class=3D"">=
std-proposals+unsubscribe@isocpp.org</a>.<br class=3D"">
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" class=3D"">std-proposals@isocpp.org</a>.<br class=3D"">
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" class=3D"">http://groups.google.com/a/isocpp.org/group/std-=
proposals/</a>.<br class=3D"">
</div></blockquote></div><br class=3D""></div></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=_92386EFB-E7D2-4BC3-B9AA-BD3236E035F3--

.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Sun, 9 Aug 2015 17:36:34 +0300
Raw View
On 9 August 2015 at 17:20, Alisdair Meredith <alisdairm@me.com> wrote:
> 'constexpr size_t std::bitset<N>::size() const noexcept=E2=80=99 may be w=
hat you are
> looking for?
>
> The main problem with this function is that it is a non-static member
> function, so you need
> an actual bitset object to use it.


Well, one can write the original example as

using MyBitset =3D bitset<128>;
static_assert(MyBitset().size() =3D=3D 128);

so I don't quite see what the problem with the non-static member
function really is.

--=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/.

.


Author: Vittorio Romeo <vittorio.romeo.vee@gmail.com>
Date: Sun, 9 Aug 2015 08:27:29 -0700 (PDT)
Raw View
------=_Part_3139_1798046429.1439134049510
Content-Type: multipart/alternative;
 boundary="----=_Part_3140_85140748.1439134049510"

------=_Part_3140_85140748.1439134049510
Content-Type: text/plain; charset=UTF-8

Ah, the constexpr member function does make this much simpler.
Still, having to instantiate the bitset feels inconsistent...

using MyBitset = std::bitset<128>;
using MyTuple = std::tuple<int, float, char>;

// static_assert(std::bitset_size<MyBitset>{} == 128, ""); // Nope.
static_assert(MyBitset{}.size() == 128, "");               // OK.
static_assert(std::tuple_size<MyTuple>{} == 3, "");        // OK.
// static_assert(MyTuple{}.size() == 3, "");               // Nope.

....but I'm probably just nitpicking.

--

---
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_3140_85140748.1439134049510
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Ah, the constexpr member function does make this much simp=
ler.<div>Still, having to instantiate the bitset feels inconsistent...</div=
><div><br><div class=3D"prettyprint" style=3D"border: 1px solid rgb(187, 18=
7, 187); word-wrap: break-word; background-color: rgb(250, 250, 250);"><cod=
e class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color:=
 #008;" class=3D"styled-by-prettify">using</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=
=3D"styled-by-prettify">MyBitset</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> std</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">::</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: #066;" class=3D"styled-by-prettify">128</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">&gt;;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><font color=3D"#0=
00000"><span style=3D"color: #008;" class=3D"styled-by-prettify">using</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span s=
tyle=3D"color: #606;" class=3D"styled-by-prettify">MyTuple</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> std</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify">tuple</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-pre=
ttify">int</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
span style=3D"color: #008;" class=3D"styled-by-prettify">float</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">char</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">&gt;;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br><br></span><span style=3D"color: #800;" class=
=3D"styled-by-prettify">// static_assert(std::bitset_size&lt;MyBitset&gt;{}=
 =3D=3D 128, &quot;&quot;); // Nope.</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br></span></font><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">static_assert</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">(</span><font color=3D"#000000"><span style=
=3D"color: #606;" class=3D"styled-by-prettify">MyBitset</span></font><span =
style=3D"color: #660;" class=3D"styled-by-prettify">{}.</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">size</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">()</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">=3D=3D</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by=
-prettify">128</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span style=3D"color: #080;" class=3D"styled-by-prettify">&quot;&quot;</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">);</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #800;" class=
=3D"styled-by-prettify">// OK.</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br></span><font color=3D"#000000"><span style=3D"color=
: #008;" class=3D"styled-by-prettify">static_assert</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">std</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify">tuple_size</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">&lt;</span><span style=3D"color: #606;" class=3D"styled-by=
-prettify">MyTuple</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">&gt;{}</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D=
=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span style=3D"color: #066;" class=3D"styled-by-prettify">3</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #080=
;" class=3D"styled-by-prettify">&quot;&quot;</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> =C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span style=3D=
"color: #800;" class=3D"styled-by-prettify">// OK.</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br></span></font><font color=3D"#6=
66600"><span style=3D"color: #800;" class=3D"styled-by-prettify">// </span>=
</font><span style=3D"color: #800;" class=3D"styled-by-prettify">static_ass=
ert(</span><font color=3D"#000000"><span style=3D"color: #800;" class=3D"st=
yled-by-prettify">MyTuple</span></font><span style=3D"color: #800;" class=
=3D"styled-by-prettify">{}.size() =3D=3D 3, &quot;&quot;); =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0</span><span style=3D"color: #800;" class=
=3D"styled-by-prettify"> // Nope.</span><font color=3D"#000000"><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span></font></div></co=
de></div><br>...but I&#39;m probably just nitpicking.</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_3140_85140748.1439134049510--
------=_Part_3139_1798046429.1439134049510--

.


Author: David Krauss <potswa@gmail.com>
Date: Mon, 10 Aug 2015 10:42:23 +0800
Raw View
--Apple-Mail=_C206E6FD-DB4D-4EEE-BEF2-87360F636127
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8


> On 2015=E2=80=9308=E2=80=9309, at 10:07 PM, Vittorio Romeo <vittorio.rome=
o.vee@gmail.com> wrote:
>=20
> If there's no such proposal, and everyone is fine with this idea, I would=
 be happy to write and submit one.

Why not make std::bitset follow the tuple-like interface? It=E2=80=99s not =
much different from std::array.

The only moderately odd part is that std::get would return bitset::referenc=
e or bool, regardless of the argument being an lvalue or rvalue.

--=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=_C206E6FD-DB4D-4EEE-BEF2-87360F636127
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=9309, at 10:07 PM, Vittorio Romeo &lt;<a href=3D"mailto:vittorio.rom=
eo.vee@gmail.com" class=3D"">vittorio.romeo.vee@gmail.com</a>&gt; wrote:</d=
iv><br class=3D"Apple-interchange-newline"><div class=3D""><div dir=3D"ltr"=
 style=3D"font-family: Helvetica; font-size: 12px; font-style: normal; font=
-variant: normal; font-weight: normal; letter-spacing: normal; line-height:=
 normal; orphans: auto; text-align: start; text-indent: 0px; text-transform=
: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-=
stroke-width: 0px;" class=3D""><div class=3D"">If there's no such proposal,=
 and everyone is fine with this idea, I would be happy to write and submit =
one.</div></div></div></blockquote><div><br class=3D""></div><div>Why not m=
ake <font face=3D"Courier" class=3D"">std::bitset</font> follow the tuple-l=
ike interface? It=E2=80=99s not much different from <font face=3D"Courier" =
class=3D"">std::array</font>.</div><div><br class=3D""></div><div>The only =
moderately odd part is that <font face=3D"Courier" class=3D"">std::get</fon=
t> would return <font face=3D"Courier" class=3D"">bitset::reference</font> =
or <font face=3D"Courier" class=3D"">bool</font>, regardless of the argumen=
t being an lvalue or rvalue.</div><div><br class=3D""></div></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=_C206E6FD-DB4D-4EEE-BEF2-87360F636127--

.