Topic: Suggestion to improve C++11 std::is_signed<> behaviour
Author: hermann.fuerntratt@joanneum.at
Date: Mon, 9 Nov 2015 02:05:50 -0800 (PST)
Raw View
------=_Part_1856_84047868.1447063550744
Content-Type: multipart/alternative;
boundary="----=_Part_1857_1342874615.1447063550744"
------=_Part_1857_1342874615.1447063550744
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
=20
Dear C++ team,=20
recently I had a problem with strongly typed enums, for which is_signed<>=
=20
always returns false (=20
http://stackoverflow.com/questions/33363994/stdis-signed-does-not-work-for-=
strongly-typed-enums-int=20
<https://u1524457.ct.sendgrid.net/wf/click?upn=3DOFh4zqILlvzue7nczzN9io68fz=
5sw36WWFjQp0MRkTnVXaitg-2BiVhRnkEHGjb3PGn4h3SbGSJRj48Cn47JPh6h2F3ezJ5r-2BBS=
CYpXsRTdLJa5X7LHQhL3VygDxVfzwnNHaa9mJFWenm0gotxnhmo-2Fg-3D-3D_uoQOw53Jnd2od=
Jf4vBwXdbuT-2BTlWPiqIaFn6Uqc0C7fVpTQAUFkSPdsUoWfBqU4HtYccnvbV5H-2BqwvuA4171=
S-2FPs8jkd-2B3-2FLZDnXEEC28B3kAPrzAv2uzUWxKLAjsflHT-2B3ihHt4dog4r3j-2BuBdHX=
aMfAcmoduYuOI45c3cE-2FJaMrpQH2MrT-2B9D9z5O48-2Fd8d6WGPuC550dDxFV0-2Bx7ybg-3=
D-3D>=20
) even for enums typed as :signed int.=20
I know this is correct according to the standard (section 3.9.1) but =E2=80=
=93 I=20
think it is still a trap for a lot of C++ programmers, who are not familiar=
=20
with the 1334 pages of the draft.=20
As a workaround for my problem a person named Piotr Skotnicki suggested an=
=20
alternative version of is_signed<>, which returns the correct result for=20
strongly typed enums based on a signed underlying type as well.
So, I would kindly suggest to extend the current version of=20
std::is_signed<> with the =E2=80=93 in my humble opinion, more complete and=
error=20
safe =E2=80=93 version Piotr came up with:
#include <type_traits>
template <typename T> struct identity { using type =3D T; };
template <typename T>=20
struct is_signed
: std::is_signed<typename std::conditional<std::is_enum<T>::value
, std::underlying_type<T>
, identity<T>>::type::type> {};
Thank you, best regards,=20
Hermann
--=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/.
------=_Part_1857_1342874615.1447063550744
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]-->
<p><span style=3D"font-size:10.0pt"><br></span></p><p><span style=3D"font-s=
ize:10.0pt">Dear C++ team, <br></span></p><p><span style=3D"font-size:10.0p=
t">recently I had a problem with
strongly typed enums, for which is_signed<> always returns false ( <a=
href=3D"https://u1524457.ct.sendgrid.net/wf/click?upn=3DOFh4zqILlvzue7nczz=
N9io68fz5sw36WWFjQp0MRkTnVXaitg-2BiVhRnkEHGjb3PGn4h3SbGSJRj48Cn47JPh6h2F3ez=
J5r-2BBSCYpXsRTdLJa5X7LHQhL3VygDxVfzwnNHaa9mJFWenm0gotxnhmo-2Fg-3D-3D_uoQOw=
53Jnd2odJf4vBwXdbuT-2BTlWPiqIaFn6Uqc0C7fVpTQAUFkSPdsUoWfBqU4HtYccnvbV5H-2Bq=
wvuA4171S-2FPs8jkd-2B3-2FLZDnXEEC28B3kAPrzAv2uzUWxKLAjsflHT-2B3ihHt4dog4r3j=
-2BuBdHXaMfAcmoduYuOI45c3cE-2FJaMrpQH2MrT-2B9D9z5O48-2Fd8d6WGPuC550dDxFV0-2=
Bx7ybg-3D-3D" target=3D"_blank">http://stackoverflow.com/questions/33363994=
/stdis-signed-does-not-work-for-strongly-typed-enums-int</a>
) even for enums typed as :signed int. <br></span></p><p><span style=3D"fon=
t-size:10.0pt"><br></span></p><p><span style=3D"font-size:10.0pt">I know th=
is is correct according to the
standard (section 3.9.1) but =E2=80=93 I think it is still a trap for a lot=
of C++
programmers, who are not familiar with the 1334 pages of the draft. <br></s=
pan></p><p><span style=3D"font-size:10.0pt">As a
workaround for my problem a person named Piotr Skotnicki suggested an
alternative version of is_signed<>, which returns the correct result =
for
strongly typed enums based on a signed underlying type as well.</span></p><=
p><span style=3D"font-size:10.0pt"><br></span></p>
<p><span style=3D"font-size:10.0pt">So, I would kindly suggest to extend th=
e
current version of std::is_signed<> with the =E2=80=93 in my humble o=
pinion, more
complete and error safe =E2=80=93 version Piotr came up with:</span></p><p>=
<span style=3D"font-size:10.0pt"><br></span></p>
<p><span style=3D"font-family: courier new,monospace;"><span style=3D"font-=
size:10.0pt">#include <type_traits></span></span></p><p><span style=
=3D"font-family: courier new,monospace;"><span style=3D"font-size:10.0pt"><=
br></span></span></p><span style=3D"font-family: courier new,monospace;">
</span><p><span style=3D"font-family: courier new,monospace;"><span style=
=3D"font-size:10.0pt">template <typename T> struct identity {
using type =3D T; };</span></span></p><p><span style=3D"font-family: courie=
r new,monospace;"><span style=3D"font-size:10.0pt"><br></span></span></p><p=
><span style=3D"font-family: courier new,monospace;"><span style=3D"font-si=
ze:10.0pt"></span></span></p><span style=3D"font-family: courier new,monosp=
ace;">
</span><p><span style=3D"font-family: courier new,monospace;"><span style=
=3D"font-size:10.0pt">template <typename T> <br></span></span></p><p>=
<span style=3D"font-family: courier new,monospace;"><span style=3D"font-siz=
e:10.0pt">struct is_signed</span></span></p><span style=3D"font-family: cou=
rier new,monospace;">
</span><pre><span style=3D"font-family: courier new,monospace;">: std::is_s=
igned<typename std::conditional<std::is_enum<T>::value</span></=
pre><pre><span style=3D"font-family: courier new,monospace;">, std::underly=
ing_type<T></span></pre><pre><span style=3D"font-family: courier new,=
monospace;">, identity<T>>::type::type> {};<br><br></span></pre=
><span style=3D"font-family: courier new,monospace;">
</span><p><span style=3D"font-size:10.0pt">Thank you, best regards, <br></s=
pan></p><p><span style=3D"font-size:10.0pt">Hermann</span></p><p><span styl=
e=3D"font-size:10.0pt"><br></span></p>
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>DE-AT</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=3D"Cambria Math"/>
<m:brkBin m:val=3D"before"/>
<m:brkBinSub m:val=3D"--"/>
<m:smallFrac m:val=3D"off"/>
<m:dispDef/>
<m:lMargin m:val=3D"0"/>
<m:rMargin m:val=3D"0"/>
<m:defJc m:val=3D"centerGroup"/>
<m:wrapIndent m:val=3D"1440"/>
<m:intLim m:val=3D"subSup"/>
<m:naryLim m:val=3D"undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState=3D"false" DefUnhideWhenUsed=3D"true"
DefSemiHidden=3D"true" DefQFormat=3D"false" DefPriority=3D"99"
LatentStyleCount=3D"267">
<w:LsdException Locked=3D"false" Priority=3D"0" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Normal"/>
<w:LsdException Locked=3D"false" Priority=3D"9" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"heading 1"/>
<w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 2"/>
<w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 3"/>
<w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 4"/>
<w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 5"/>
<w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 6"/>
<w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 7"/>
<w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 8"/>
<w:LsdException Locked=3D"false" Priority=3D"9" QFormat=3D"true" Name=3D"=
heading 9"/>
<w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 1"/>
<w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 2"/>
<w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 3"/>
<w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 4"/>
<w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 5"/>
<w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 6"/>
<w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 7"/>
<w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 8"/>
<w:LsdException Locked=3D"false" Priority=3D"39" Name=3D"toc 9"/>
<w:LsdException Locked=3D"false" Priority=3D"35" QFormat=3D"true" Name=3D=
"caption"/>
<w:LsdException Locked=3D"false" Priority=3D"10" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Title"/>
<w:LsdException Locked=3D"false" Priority=3D"1" Name=3D"Default Paragraph=
Font"/>
<w:LsdException Locked=3D"false" Priority=3D"11" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Subtitle"/>
<w:LsdException Locked=3D"false" Priority=3D"22" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Strong"/>
<w:LsdException Locked=3D"false" Priority=3D"20" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Emphasis"/>
<w:LsdException Locked=3D"false" Priority=3D"59" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Table Grid"/>
<w:LsdException Locked=3D"false" UnhideWhenUsed=3D"false" Name=3D"Placeho=
lder Text"/>
<w:LsdException Locked=3D"false" Priority=3D"1" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"No Spacing"/>
<w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Shading"/>
<w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light List"/>
<w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Grid"/>
<w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1"/>
<w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2"/>
<w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 1"/>
<w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 2"/>
<w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1"/>
<w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2"/>
<w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3"/>
<w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Dark List"/>
<w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Shading"/>
<w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful List"/>
<w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Grid"/>
<w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light List Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 1"/>
<w:LsdException Locked=3D"false" UnhideWhenUsed=3D"false" Name=3D"Revisio=
n"/>
<w:LsdException Locked=3D"false" Priority=3D"34" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"List Paragraph"/>
<w:LsdException Locked=3D"false" Priority=3D"29" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Quote"/>
<w:LsdException Locked=3D"false" Priority=3D"30" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Intense Quote"/>
<w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 1"/>
<w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light List Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 2"/>
<w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light List Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 3"/>
<w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light List Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 4"/>
<w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light List Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 5"/>
<w:LsdException Locked=3D"false" Priority=3D"60" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Shading Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"61" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light List Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"62" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Light Grid Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"63" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 1 Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"64" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Shading 2 Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"65" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 1 Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"66" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium List 2 Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"67" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 1 Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"68" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 2 Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"69" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Medium Grid 3 Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"70" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Dark List Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"71" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Shading Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"72" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful List Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"73" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" Name=3D"Colorful Grid Accent 6"/>
<w:LsdException Locked=3D"false" Priority=3D"19" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Subtle Emphasis"/>
<w:LsdException Locked=3D"false" Priority=3D"21" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Intense Emphasis"/>
<w:LsdException Locked=3D"false" Priority=3D"31" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Subtle Reference"/>
<w:LsdException Locked=3D"false" Priority=3D"32" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Intense Reference"/>
<w:LsdException Locked=3D"false" Priority=3D"33" SemiHidden=3D"false"
UnhideWhenUsed=3D"false" QFormat=3D"true" Name=3D"Book Title"/>
<w:LsdException Locked=3D"false" Priority=3D"37" Name=3D"Bibliography"/>
<w:LsdException Locked=3D"false" Priority=3D"39" QFormat=3D"true" Name=3D=
"TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Normale Tabelle";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
</style>
<![endif]--></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_1857_1342874615.1447063550744--
------=_Part_1856_84047868.1447063550744--
.
Author: "'Matt Calabrese' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Mon, 9 Nov 2015 11:46:49 -0800
Raw View
--001a11c2e6aea9266c052420da0a
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Mon, Nov 9, 2015 at 2:05 AM, <hermann.fuerntratt@joanneum.at> wrote:I
know this is correct according to the standard (section 3.9.1) but =E2=80=
=93 I
think it is still a trap for a lot of C++ programmers, who are not familiar
with the 1334 pages of the draft.
>
> As a workaround for my problem a person named Piotr Skotnicki suggested a=
n
> alternative version of is_signed<>, which returns the correct result for
> strongly typed enums based on a signed underlying type as well.
>
> So, I would kindly suggest to extend the current version of
> std::is_signed<> with the =E2=80=93 in my humble opinion, more complete a=
nd error
> safe =E2=80=93 version Piotr came up with
>
If you really want this functionality I do not think it is appropriate for
std::is_signed. Existing uses of std::is_signed often occur in code that
branches off at compile-time based on the result, and that code can assume
that the result is an actual arithmetic type (i.e. if std::is_signed
reports true, a template body can assume that the template argument is one
of the arithmetic types and also that arithmetic operations exist for the
type, etc.). Changing std::is_signed in this manner alters its meaning in a
way that can make facilities that use the template now have unintended
results.
--=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/.
--001a11c2e6aea9266c052420da0a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On M=
on, Nov 9, 2015 at 2:05 AM, <span dir=3D"ltr"><<a href=3D"mailto:herman=
n.fuerntratt@joanneum.at" target=3D"_blank">hermann.fuerntratt@joanneum.at<=
/a>></span> wrote:<span style=3D"font-size:10pt">I know this is correct =
according to the
standard (section 3.9.1) but =E2=80=93 I think it is still a trap for a lot=
of C++
programmers, who are not familiar with the 1334 pages of the draft.=C2=A0</=
span><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-le=
ft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><p><span style=3D"font=
-size:10.0pt">As a
workaround for my problem a person named Piotr Skotnicki suggested an
alternative version of is_signed<>, which returns the correct result =
for
strongly typed enums based on a signed underlying type as well.</span></p>
<p><span style=3D"font-size:10.0pt">So, I would kindly suggest to extend th=
e
current version of std::is_signed<> with the =E2=80=93 in my humble o=
pinion, more
complete and error safe =E2=80=93 version Piotr came up with</span></p></di=
v></blockquote><div>If you really want this functionality I do not think it=
is appropriate for std::is_signed. Existing uses of std::is_signed often o=
ccur in code that branches off at compile-time based on the result, and tha=
t code can assume that the result is an actual arithmetic type (i.e. if std=
::is_signed reports true, a template body can assume that the template argu=
ment is one of the arithmetic types and also that arithmetic operations exi=
st for the type, etc.). Changing std::is_signed in this manner alters its m=
eaning in a way that can make facilities that use the template now have uni=
ntended results.</div></div></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" 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 />
--001a11c2e6aea9266c052420da0a--
.
Author: Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
Date: Mon, 9 Nov 2015 23:32:00 -0800 (PST)
Raw View
------=_Part_5519_1238522485.1447140720166
Content-Type: multipart/alternative;
boundary="----=_Part_5520_233112474.1447140720166"
------=_Part_5520_233112474.1447140720166
Content-Type: text/plain; charset=UTF-8
But isn't it *completely counter intuitive*, that a type which is based on
a signed type suddenly looses its "signedness" just because its an enum?
>
--
---
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_5520_233112474.1447140720166
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><div class=3D"gmail_quote"><div>But isn't it <i><=
b>completely counter intuitive</b></i>, that a type which is based on a sig=
ned type suddenly looses its "signedness" just because its an enu=
m?<br></div></div></div><blockquote class=3D"gmail_quote" style=3D"margin: =
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">
</blockquote></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_5520_233112474.1447140720166--
------=_Part_5519_1238522485.1447140720166--
.
Author: Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
Date: Tue, 10 Nov 2015 00:04:33 -0800 (PST)
Raw View
------=_Part_5685_1327735126.1447142674005
Content-Type: multipart/alternative;
boundary="----=_Part_5686_1833432441.1447142674006"
------=_Part_5686_1833432441.1447142674006
Content-Type: text/plain; charset=UTF-8
// If you would see:
enum E : signed int { Val1 = -1, Val2 = 1, }; // What would you guess that
std::is_signed<E>::value // would return?
>
--
---
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_5686_1833432441.1447142674006
Content-Type: text/html; charset=UTF-8
<div dir="ltr"><br><div dir="ltr"><span style="font-size:9.5pt;line-height:115%;font-family:Consolas;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;color:black;
background:white;mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA" lang="EN-US">// If you would see:</span><br><br><!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]--><span style="font-size:9.5pt;line-height:
115%;font-family:Consolas;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;color:blue;background:white;mso-highlight:white;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA" lang="EN-US">enum</span><span style="font-size:9.5pt;line-height:115%;font-family:Consolas;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;color:black;
background:white;mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA" lang="EN-US"> </span><span style="font-size:9.5pt;
line-height:115%;font-family:Consolas;mso-fareast-font-family:Calibri;
mso-fareast-theme-font:minor-latin;color:#2B91AF;background:white;mso-highlight:
white;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:
AR-SA" lang="EN-US">E</span><span style="font-size:9.5pt;line-height:115%;
font-family:Consolas;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;color:black;background:white;mso-highlight:white;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA" lang="EN-US"> : </span><span style="font-size:9.5pt;line-height:115%;font-family:Consolas;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;color:blue;
background:white;mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA" lang="EN-US">signed</span><span style="font-size:
9.5pt;line-height:115%;font-family:Consolas;mso-fareast-font-family:Calibri;
mso-fareast-theme-font:minor-latin;color:black;background:white;mso-highlight:
white;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:
AR-SA" lang="EN-US"> </span><span style="font-size:9.5pt;line-height:115%;
font-family:Consolas;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;color:blue;background:white;mso-highlight:white;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA" lang="EN-US">int</span><span style="font-size:9.5pt;line-height:115%;font-family:Consolas;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;color:black;
background:white;mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA" lang="EN-US"> { </span><span style="font-size:
9.5pt;line-height:115%;font-family:Consolas;mso-fareast-font-family:Calibri;
mso-fareast-theme-font:minor-latin;color:darkslategray;background:white;
mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA" lang="EN-US">Val1</span><span style="font-size:9.5pt;
line-height:115%;font-family:Consolas;mso-fareast-font-family:Calibri;
mso-fareast-theme-font:minor-latin;color:black;background:white;mso-highlight:
white;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:
AR-SA" lang="EN-US"> = -1, </span><span style="font-size:9.5pt;line-height:115%;
font-family:Consolas;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;color:darkslategray;background:white;mso-highlight:white;
mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA" lang="EN-US">Val2</span><span style="font-size:9.5pt;line-height:115%;font-family:Consolas;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;color:black;
background:white;mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA" lang="EN-US"> = 1, }; // What would you guess that<br><br></span><!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]--><span style="font-size:9.5pt;line-height:
115%;font-family:Consolas;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;color:black;background:white;mso-highlight:white;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA" lang="EN-US">std::</span><span style="font-size:9.5pt;line-height:115%;font-family:Consolas;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;color:#2B91AF;
background:white;mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA" lang="EN-US">is_signed</span><span style="font-size:9.5pt;line-height:115%;font-family:Consolas;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;color:black;background:white;
mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA" lang="EN-US"><E>::value // would return?</span><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>DE-AT</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Normale Tabelle";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-fareast-language:EN-US;}
</style>
<![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>DE-AT</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Normale Tabelle";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-fareast-language:EN-US;}
</style>
<![endif]--><br><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />
------=_Part_5686_1833432441.1447142674006--
------=_Part_5685_1327735126.1447142674005--
.
Author: Jim Porter <jvp4846@g.rit.edu>
Date: Tue, 10 Nov 2015 02:40:45 -0600
Raw View
On 11/10/2015 1:32 AM, Xxxx Yyyy wrote:
> But isn't it /*completely counter intuitive*/, that a type which is
> based on a signed type suddenly looses its "signedness" just because its
> an enum?
I wouldn't say it's any more counter-intuitive than the fact that, for a
user-defined BigInt class, std::is_signed<BigInt> is false. Many of the
traits in <type_traits> are designed to detect only built-in types (e.g.
std::is_integral, std::is_array, std::is_pointer), so a user familiar
with any of these would likely conclude - correctly - that
std::is_signed only applies to built-in arithmetic types.
- Jim
--
---
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/.
.
Author: Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
Date: Tue, 10 Nov 2015 01:01:38 -0800 (PST)
Raw View
------=_Part_103_777324576.1447146098392
Content-Type: multipart/alternative;
boundary="----=_Part_104_375479266.1447146098393"
------=_Part_104_375479266.1447146098393
Content-Type: text/plain; charset=UTF-8
.... so a user familiar
> with any of these would likely conclude - correctly - that
> std::is_signed only applies to built-in arithmetic types.
>
> - Jim
>
>
That is exactly my point: a user, *familiar with any of these*...
I'd like to do a little survey, asking all the people that are not yet
familiar, what they would guess what
enum E : signed int { Val1 = -1, Val2 = 1, };
std::is_signed<E>::value // would return?
+1 if the expected answer is: yes, its signed
--
---
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_104_375479266.1447146098393
Content-Type: text/html; charset=UTF-8
<div dir="ltr">... so a user familiar
<br><blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">with any of these would likely conclude - correctly - that
<br>std::is_signed only applies to built-in arithmetic types.
<br>
<br>- Jim
<br>
<br></blockquote><div><br>That is exactly my point: a user, <b>familiar with any of these</b>...<br><br>I'd like to do a little survey, asking all the people that are not yet familiar, what they would guess what<br><br><!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]--><span style="font-size:9.5pt;font-family:
Consolas;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;
color:blue;background:white;mso-highlight:white;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA" lang="EN-US">enum</span><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;color:black;background:white;
mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA" lang="EN-US"> </span><span style="font-size:9.5pt;
font-family:Consolas;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;color:#2B91AF;background:white;mso-highlight:white;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA" lang="EN-US">E</span><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;color:black;background:white;
mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA" lang="EN-US"> : </span><span style="font-size:9.5pt;
font-family:Consolas;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;color:blue;background:white;mso-highlight:white;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA" lang="EN-US">signed</span><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;color:black;background:white;
mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA" lang="EN-US"> </span><span style="font-size:9.5pt;
font-family:Consolas;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;color:blue;background:white;mso-highlight:white;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA" lang="EN-US">int</span><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;color:black;background:white;
mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA" lang="EN-US"> { </span><span style="font-size:9.5pt;
font-family:Consolas;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;color:darkslategray;background:white;mso-highlight:white;
mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA" lang="EN-US">Val1</span><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;color:black;background:white;
mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA" lang="EN-US"> = -1, </span><span style="font-size:9.5pt;
font-family:Consolas;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;color:darkslategray;background:white;mso-highlight:white;
mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA" lang="EN-US">Val2</span><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;color:black;background:white;
mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:EN-US;
mso-bidi-language:AR-SA" lang="EN-US"> = 1, }; <br>
std::</span><span style="font-size:9.5pt;font-family:Consolas;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;color:#2B91AF;
background:white;mso-highlight:white;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA" lang="EN-US">is_signed</span><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-font-family:Calibri;
mso-fareast-theme-font:minor-latin;color:black;background:white;mso-highlight:
white;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:
AR-SA" lang="EN-US"><E>::value // would return?</span><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>DE-AT</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Normale Tabelle";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-fareast-language:EN-US;}
</style>
<![endif]--><br><br>+1 if the expected answer is: yes, its signed<br><br><br><br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />
------=_Part_104_375479266.1447146098393--
------=_Part_103_777324576.1447146098392--
.
Author: Jean-Marc Bourguet <jm.bourguet@gmail.com>
Date: Tue, 10 Nov 2015 05:48:33 -0800 (PST)
Raw View
------=_Part_450_1536917990.1447163313933
Content-Type: multipart/alternative;
boundary="----=_Part_451_1804080537.1447163313934"
------=_Part_451_1804080537.1447163313934
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Le mardi 10 novembre 2015 10:01:38 UTC+1, Xxxx Yyyy a =C3=A9crit :
>
> ... so a user familiar=20
>
>> with any of these would likely conclude - correctly - that=20
>> std::is_signed only applies to built-in arithmetic types.=20
>>
>> - Jim=20
>>
>>
> That is exactly my point: a user, *familiar with any of these*...
>
> I'd like to do a little survey, asking all the people that are not yet=20
> familiar, what they would guess what
>
> enum E : signed int { Val1 =3D -1, Val2 =3D 1, };=20
> std::is_signed<E>::value // would return?
>
> +1 if the expected answer is: yes, its signed
>
I don't know what signed means for a type which does not provide arithmetic=
=20
nor have a zero value, so it is not signed in my book. Note that I'd=20
answer the same thing for is_unsigned<E>. There are three kinds of type,=
=20
signed, unsigned and those like E which are neither.=20
--=20
Jean-Marc
--=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/.
------=_Part_451_1804080537.1447163313934
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<br><br>Le mardi 10 novembre 2015 10:01:38 UTC+1, Xxxx Yyyy a =C3=A9crit=C2=
=A0:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex=
;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">... so a =
user familiar=20
<br><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex">with any of these would likely =
conclude - correctly - that=20
<br>std::is_signed only applies to built-in arithmetic types.
<br>
<br>- Jim
<br>
<br></blockquote><div><br>That is exactly my point: a user, <b>familiar wit=
h any of these</b>...<br><br>I'd like to do a little survey, asking all=
the people that are not yet familiar, what they would guess what<br><br><s=
pan style=3D"font-size:9.5pt;font-family:Consolas;color:blue;background:whi=
te" lang=3D"EN-US">enum</span><span style=3D"font-size:9.5pt;font-family:Co=
nsolas;color:black;background:white" lang=3D"EN-US"> </span><span style=3D"=
font-size:9.5pt;font-family:Consolas;color:#2b91af;background:white" lang=
=3D"EN-US">E</span><span style=3D"font-size:9.5pt;font-family:Consolas;colo=
r:black;background:white" lang=3D"EN-US"> : </span><span style=3D"font-size=
:9.5pt;font-family:Consolas;color:blue;background:white" lang=3D"EN-US">sig=
ned</span><span style=3D"font-size:9.5pt;font-family:Consolas;color:black;b=
ackground:white" lang=3D"EN-US"> </span><span style=3D"font-size:9.5pt;font=
-family:Consolas;color:blue;background:white" lang=3D"EN-US">int</span><spa=
n style=3D"font-size:9.5pt;font-family:Consolas;color:black;background:whit=
e" lang=3D"EN-US"> { </span><span style=3D"font-size:9.5pt;font-family:Cons=
olas;color:darkslategray;background:white" lang=3D"EN-US">Val1</span><span =
style=3D"font-size:9.5pt;font-family:Consolas;color:black;background:white"=
lang=3D"EN-US"> =3D -1, </span><span style=3D"font-size:9.5pt;font-family:=
Consolas;color:darkslategray;background:white" lang=3D"EN-US">Val2</span><s=
pan style=3D"font-size:9.5pt;font-family:Consolas;color:black;background:wh=
ite" lang=3D"EN-US"> =3D 1, }; <br>
std::</span><span style=3D"font-size:9.5pt;font-family:Consolas;color:#2b91=
af;background:white" lang=3D"EN-US">is_signed</span><span style=3D"font-siz=
e:9.5pt;font-family:Consolas;color:black;background:white" lang=3D"EN-US">&=
lt;E>::value // would return?</span><br><br>+1 if the expected answer is=
: yes, its signed<br></div></div></blockquote><div><br></div><div>I don'=
;t know what signed means for a type which does not provide arithmetic nor =
have a zero value, so it is not signed in my book. =C2=A0Note that I'd =
answer the same thing for is_unsigned<E>. =C2=A0There are three kinds=
of type, signed, unsigned and those like E which are neither.=C2=A0</div><=
div><br></div><div>--=C2=A0</div><div>Jean-Marc</div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_451_1804080537.1447163313934--
------=_Part_450_1536917990.1447163313933--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Tue, 10 Nov 2015 05:52:31 -0800 (PST)
Raw View
------=_Part_425_1496351570.1447163551165
Content-Type: multipart/alternative;
boundary="----=_Part_426_920558619.1447163551166"
------=_Part_426_920558619.1447163551166
Content-Type: text/plain; charset=UTF-8
On Tuesday, November 10, 2015 at 4:01:38 AM UTC-5, Xxxx Yyyy wrote:
>
> ... so a user familiar
>
>> with any of these would likely conclude - correctly - that
>> std::is_signed only applies to built-in arithmetic types.
>>
>> - Jim
>>
>>
> That is exactly my point: a user, *familiar with any of these*...
>
The problem with your way of thinking is this: you believe that an enum *is*
its underlying type.
It is not.
Enum types are not intended to be equivalent to their underlying types.
They are separate and distinct from their underlying types. Yes, you can
convert from one to the other explicitly. But the operations you can do on
one are not the same as the operations you can do on the other.
Therefore, when you call a template metafunction with an enum, you should
not automatically get the same result as if you called the metafunction
with `std::underlying_type<enumeration>::type`.
It doesn't matter what users may be "familiar" with or not. This is the
right behavior.
--
---
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_426_920558619.1447163551166
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Tuesday, November 10, 2015 at 4:01:38 AM UTC-5, Xxxx Yy=
yy wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: =
0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">... =
so a user familiar=20
<br><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex">with any of these would likely =
conclude - correctly - that=20
<br>std::is_signed only applies to built-in arithmetic types.
<br>
<br>- Jim
<br>
<br></blockquote><div><br>That is exactly my point: a user, <b>familiar wit=
h any of these</b>...<br></div></div></blockquote><div><br>The problem with=
your way of thinking is this: you believe that an enum <u><i>is</i></u> it=
s underlying type.<br><br>It is not.<br><br>Enum types are not intended to =
be equivalent to their underlying types. They are separate and distinct fro=
m their underlying types. Yes, you can convert from one to the other explic=
itly. But the operations you can do on one are not the same as the operatio=
ns you can do on the other.<br><br>Therefore, when you call a template meta=
function with an enum, you should not automatically get the same result as =
if you called the metafunction with `std::underlying_type<enumeration>=
;::type`.<br><br>It doesn't matter what users may be "familiar&quo=
t; with or not. This is the right behavior.<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" 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_426_920558619.1447163551166--
------=_Part_425_1496351570.1447163551165--
.
Author: Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
Date: Tue, 10 Nov 2015 06:37:16 -0800 (PST)
Raw View
------=_Part_167_1268951876.1447166236570
Content-Type: multipart/alternative;
boundary="----=_Part_168_1723983536.1447166236570"
------=_Part_168_1723983536.1447166236570
Content-Type: text/plain; charset=UTF-8
Am Dienstag, 10. November 2015 14:52:31 UTC+1 schrieb Nicol Bolas:
>
> On Tuesday, November 10, 2015 at 4:01:38 AM UTC-5, Xxxx Yyyy wrote:
>>
>> ... so a user familiar
>>
>>> with any of these would likely conclude - correctly - that
>>> std::is_signed only applies to built-in arithmetic types.
>>>
>>> - Jim
>>>
>>>
>> That is exactly my point: a user, *familiar with any of these*...
>>
>
> The problem with your way of thinking is this: you believe that an enum
> *is* its underlying type.
>
> It is not.
>
> Enum types are not intended to be equivalent to their underlying types.
> They are separate and distinct from their underlying types. Yes, you can
> convert from one to the other explicitly. But the operations you can do on
> one are not the same as the operations you can do on the other.
>
> Therefore, when you call a template metafunction with an enum, you should
> not automatically get the same result as if you called the metafunction
> with `std::underlying_type<enumeration>::type`.
>
> It doesn't matter what users may be "familiar" with or not. This is the
> right behavior.
>
It is clear, that an enum is not its underlying type.
It is completely unclear, why is_signed<> doesn't take the holistic
approach, because signedness does not interfere with any other type
property.
So for me, it would be better to rename is_signed<> to something like
is_arithmetic_signed<> cause that's what it really is.
It doesn't matter what users may be "familiar" with or not. This is the
> right behavior.
>
That sounds a bit harsh, as I think, the standard is not yet chiseled in
stone.
--
---
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_168_1723983536.1447166236570
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<br><br>Am Dienstag, 10. November 2015 14:52:31 UTC+1 schrieb Nicol Bolas:<=
blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bord=
er-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">On Tuesday, No=
vember 10, 2015 at 4:01:38 AM UTC-5, Xxxx Yyyy wrote:<blockquote class=3D"g=
mail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"ltr">... so a user familiar=20
<br><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex">with any of these would likely =
conclude - correctly - that=20
<br>std::is_signed only applies to built-in arithmetic types.
<br>
<br>- Jim
<br>
<br></blockquote><div><br>That is exactly my point: a user, <b>familiar wit=
h any of these</b>...<br></div></div></blockquote><div><br>The problem with=
your way of thinking is this: you believe that an enum <u><i>is</i></u> it=
s underlying type.<br><br>It is not.<br><br>Enum types are not intended to =
be equivalent to their underlying types. They are separate and distinct fro=
m their underlying types. Yes, you can convert from one to the other explic=
itly. But the operations you can do on one are not the same as the operatio=
ns you can do on the other.<br><br>Therefore, when you call a template meta=
function with an enum, you should not automatically get the same result as =
if you called the metafunction with `std::underlying_type<<wbr>enumerati=
on>::type`.<br><br>It doesn't matter what users may be "familia=
r" with or not. This is the right behavior.<br></div></div></blockquot=
e><div><br><br>It is clear, that an enum is not its underlying type.<br>It =
is completely unclear, why is_signed<> doesn't take the holistic =
approach, because signedness does not interfere with any other type propert=
y.<br><br>So for me, it would be better to rename is_signed<> to some=
thing like is_arithmetic_signed<> cause that's what it really is.=
<br><br><blockquote style=3D"margin: 0px 0px 0px 0.8ex; border-left: 1px so=
lid rgb(204, 204, 204); padding-left: 1ex;" class=3D"gmail_quote">It doesn&=
#39;t matter what users may be "familiar" with or not. This is th=
e right behavior.<br></blockquote><div>That sounds a bit harsh, as I think,=
the standard is not yet chiseled in stone.<br><br></div><br><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_168_1723983536.1447166236570--
------=_Part_167_1268951876.1447166236570--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Tue, 10 Nov 2015 06:47:35 -0800 (PST)
Raw View
------=_Part_3453_499310717.1447166855799
Content-Type: multipart/alternative;
boundary="----=_Part_3454_580154904.1447166855799"
------=_Part_3454_580154904.1447166855799
Content-Type: text/plain; charset=UTF-8
On Tuesday, November 10, 2015 at 9:37:16 AM UTC-5, Xxxx Yyyy wrote:
>
> Am Dienstag, 10. November 2015 14:52:31 UTC+1 schrieb Nicol Bolas:
>>
>> On Tuesday, November 10, 2015 at 4:01:38 AM UTC-5, Xxxx Yyyy wrote:
>>>
>>> ... so a user familiar
>>>
>>>> with any of these would likely conclude - correctly - that
>>>> std::is_signed only applies to built-in arithmetic types.
>>>>
>>>> - Jim
>>>>
>>>>
>>> That is exactly my point: a user, *familiar with any of these*...
>>>
>>
>> The problem with your way of thinking is this: you believe that an enum
>> *is* its underlying type.
>>
>> It is not.
>>
>> Enum types are not intended to be equivalent to their underlying types.
>> They are separate and distinct from their underlying types. Yes, you can
>> convert from one to the other explicitly. But the operations you can do on
>> one are not the same as the operations you can do on the other.
>>
>> Therefore, when you call a template metafunction with an enum, you should
>> not automatically get the same result as if you called the metafunction
>> with `std::underlying_type<enumeration>::type`.
>>
>> It doesn't matter what users may be "familiar" with or not. This is the
>> right behavior.
>>
>
>
> It is clear, that an enum is not its underlying type.
> It is completely unclear, why is_signed<> doesn't take the holistic
> approach, because signedness does not interfere with any other type
> property.
>
Is this signed:
struct E
{
signed int foo;
};
static_assert<std::is_signed<E>::value>; //???
An enum is functionally similar to `E` here. It's a user-defined type, one
which *just so happens* to have a signed type within it.
The very question of whether a user-defined type is signed or unsigned
makes no sense. It's like asking what kind of cheese the moon is made of.
Whether that type is an enum or a struct type, the question doesn't make
sense.
So for me, it would be better to rename is_signed<> to something like
> is_arithmetic_signed<> cause that's what it really is.
>
We're not going to change the name of something that's been around for 4+
years (breaking tons of code in the process) just to make it, *at best*,
slightly more clear.
It doesn't matter what users may be "familiar" with or not. This is the
>> right behavior.
>>
> That sounds a bit harsh, as I think, the standard is not yet chiseled in
> stone.
>
No, but your arguments for why it needs to be changed have not been
convincing. It's based purely on the notion that you think it's surprising,
that you believe some people won't be "familiar" with it.
--
---
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_3454_580154904.1447166855799
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Tuesday, November 10, 2015 at 9:37:16 AM UTC-5, Xxxx Yyyy wrote:<blockqu=
ote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left=
: 1px #ccc solid;padding-left: 1ex;">Am Dienstag, 10. November 2015 14:52:3=
1 UTC+1 schrieb Nicol Bolas:<blockquote class=3D"gmail_quote" style=3D"marg=
in:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div di=
r=3D"ltr">On Tuesday, November 10, 2015 at 4:01:38 AM UTC-5, Xxxx Yyyy wrot=
e:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;bor=
der-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">... so a user fa=
miliar=20
<br><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;b=
order-left:1px #ccc solid;padding-left:1ex">with any of these would likely =
conclude - correctly - that=20
<br>std::is_signed only applies to built-in arithmetic types.
<br>
<br>- Jim
<br>
<br></blockquote><div><br>That is exactly my point: a user, <b>familiar wit=
h any of these</b>...<br></div></div></blockquote><div><br>The problem with=
your way of thinking is this: you believe that an enum <u><i>is</i></u> it=
s underlying type.<br><br>It is not.<br><br>Enum types are not intended to =
be equivalent to their underlying types. They are separate and distinct fro=
m their underlying types. Yes, you can convert from one to the other explic=
itly. But the operations you can do on one are not the same as the operatio=
ns you can do on the other.<br><br>Therefore, when you call a template meta=
function with an enum, you should not automatically get the same result as =
if you called the metafunction with `std::underlying_type<<wbr>enumerati=
on>::type`.<br><br>It doesn't matter what users may be "familia=
r" with or not. This is the right behavior.<br></div></div></blockquot=
e><div><br><br>It is clear, that an enum is not its underlying type.<br>It =
is completely unclear, why is_signed<> doesn't take the holistic =
approach, because signedness does not interfere with any other type propert=
y.<br></div></blockquote><div><br>Is this signed:<br><br><div class=3D"pret=
typrint" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(1=
87, 187, 187); border-style: solid; border-width: 1px; word-wrap: break-wor=
d;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=
=3D"color: #008;" class=3D"styled-by-prettify">struct</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> E<br></span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">signed</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">int</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> foo</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">};</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span><sp=
an 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"color: #000;" class=3D"styled-by-prettify">std</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">is_signed</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify"><</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">E</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">>::</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify">value</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">>;</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> </span><span style=3D"color: #800;" class=3D"styled-by-prettify"=
>//???</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
</span></div></code></div><br>An enum is functionally similar to `E` here. =
It's a user-defined type, one which <i>just so happens</i> to have a si=
gned type within it.<br><br>The very question of whether a user-defined typ=
e is signed or unsigned makes no sense. It's like asking what kind of c=
heese the moon is made of. Whether that type is an enum or a struct type, t=
he question doesn't make sense.<br><br></div><blockquote class=3D"gmail=
_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;p=
adding-left: 1ex;"><div>So for me, it would be better to rename is_signed&l=
t;> to something like is_arithmetic_signed<> cause that's what=
it really is.<br></div></blockquote><div><br>We're not going to change=
the name of something that's been around for 4+ years (breaking tons o=
f code in the process) just to make it, <i>at best</i>, slightly more clear=
..<br><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div><blockquot=
e style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);=
padding-left:1ex" class=3D"gmail_quote">It doesn't matter what users ma=
y be "familiar" with or not. This is the right behavior.<br></blo=
ckquote><div>That sounds a bit harsh, as I think, the standard is not yet c=
hiseled in stone.<br></div></div></blockquote><div><br>No, but your argumen=
ts for why it needs to be changed have not been convincing. It's based =
purely on the notion that you think it's surprising, that you believe s=
ome people won't be "familiar" with it.<br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_3454_580154904.1447166855799--
------=_Part_3453_499310717.1447166855799--
.
Author: Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
Date: Tue, 10 Nov 2015 06:58:23 -0800 (PST)
Raw View
------=_Part_308_799277416.1447167503342
Content-Type: multipart/alternative;
boundary="----=_Part_309_1723238809.1447167503342"
------=_Part_309_1723238809.1447167503342
Content-Type: text/plain; charset=UTF-8
> Is this signed:
>
> struct E
> {
> signed int foo;
> };
>
> static_assert<std::is_signed<E>::value>; //???
>
>
No, it is not signed, as it is just a struct containing a signed int.
We're not going to change the name of something that's been around for 4+
> years (breaking tons of code in the process) just to make it, *at best*,
> slightly more clear.
>
This is always a good argument not to touch anything ;)
It doesn't matter what users may be "familiar" with or not. This is the
>>> right behavior.
>>>
>> That sounds a bit harsh, as I think, the standard is not yet chiseled in
>> stone.
>>
>
> No, but your arguments for why it needs to be changed have not been
> convincing. It's based purely on the notion that you think it's surprising,
> that you believe some people won't be "familiar" with it.
>
Actually the thing about "familiarity" was coming from Jim Porter, who
explained, that C++ specialists are familiar with the subtle facts we are
talking about here.
--
---
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_309_1723238809.1447167503342
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<br><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex=
;border-left: 1px #ccc solid;padding-left: 1ex;"><div>Is this signed:<br><b=
r><div 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><div><=
span style=3D"color:#008">struct</span><span style=3D"color:#000"> E<br></s=
pan><span style=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=
=A0 </span><span style=3D"color:#008">signed</span><span style=3D"color:#00=
0"> </span><span style=3D"color:#008">int</span><span style=3D"color:#000">=
foo</span><span style=3D"color:#660">;</span><span style=3D"color:#000"><b=
r></span><span style=3D"color:#660">};</span><span style=3D"color:#000"><br=
><br></span><span style=3D"color:#008">static_assert</span><span style=3D"c=
olor:#660"><</span><span style=3D"color:#000">std</span><span style=3D"c=
olor:#660">::</span><span style=3D"color:#000">is_signed</span><span style=
=3D"color:#660"><</span><span style=3D"color:#000">E</span><span style=
=3D"color:#660"><wbr>>::</span><span style=3D"color:#000">value</span><s=
pan style=3D"color:#660">>;</span><span style=3D"color:#000"> </span><sp=
an style=3D"color:#800">//???</span><span style=3D"color:#000"><br></span><=
/div></code></div><br></div></blockquote><div><br>No, it is not signed, as =
it is just a struct containing a signed int.<br><br><br><blockquote style=
=3D"margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 204); p=
adding-left: 1ex;" class=3D"gmail_quote">We're not going to change the =
name of something that's been around for 4+ years (breaking tons of cod=
e in the process) just to make it, <i>at best</i>, slightly more clear.<br>=
</blockquote><br>This is always a good argument not to touch anything ;)<br=
><br><br><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;mar=
gin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><blockquote=
class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px =
#ccc solid;padding-left:1ex"><div><blockquote style=3D"margin:0px 0px 0px 0=
..8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class=3D"gmai=
l_quote">It doesn't matter what users may be "familiar" with =
or not. This is the right behavior.<br></blockquote><div>That sounds a bit =
harsh, as I think, the standard is not yet chiseled in stone.<br></div></di=
v></blockquote><div><br>No, but your arguments for why it needs to be chang=
ed have not been convincing. It's based purely on the notion that you t=
hink it's surprising, that you believe some people won't be "f=
amiliar" with it.<br></div></blockquote><div><br>Actually the thing ab=
out "familiarity" was coming from Jim Porter, who explained, that=
C++ specialists are familiar with the subtle facts we are talking about he=
re.<br></div><div><br><br>=C2=A0</div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_309_1723238809.1447167503342--
------=_Part_308_799277416.1447167503342--
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Tue, 10 Nov 2015 09:55:33 -0800
Raw View
On Tuesday 10 November 2015 06:37:16 Xxxx Yyyy wrote:
> It is clear, that an enum is not its underlying type.
> It is completely unclear, why is_signed<> doesn't take the holistic
> approach, because signedness does not interfere with any other type
> property.
Because other "built in" operations don't apply to enums, even if they apply
to the underlying type.
For example, basic arithmethic (addition, subtraction, multiplication,
division, modulus) are defined for the integrals but not for strongly-typed
enums.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--
---
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/.
.
Author: Jim Porter <jvp4846@g.rit.edu>
Date: Tue, 10 Nov 2015 12:30:58 -0600
Raw View
On 11/10/2015 3:01 AM, Xxxx Yyyy wrote:
> ... so a user familiar
>
> with any of these would likely conclude - correctly - that
> std::is_signed only applies to built-in arithmetic types.
>
> That is exactly my point: a user, *familiar with any of these*...
If a user isn't familiar with *any* of the type traits, they probably
shouldn't be trying to use them. Attempting to use an API you're
completely unfamiliar with and not reading the docs is a recipe for failure.
As other people in this thread have mentioned, is_signed is just an
abbreviated name for "is_signed_arithmetic". Since enums aren't
arithmetic types, is_signed must therefore be false. While this naming
might be slightly awkward to users unfamiliar with the conventions in
<type_traits>, I think the current behavior is more useful than your
proposed behavior.
I'm much more likely to care about whether an arithmetic type is signed
than whether an enum is signed. It's true that I could achieve the
former with std::is_arithmetic && std::is_signed, but I don't think the
extra verbosity would be worth it, given how little I care about
signedness of an enum.
- Jim
--
---
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/.
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Tue, 10 Nov 2015 11:07:22 -0800 (PST)
Raw View
------=_Part_784_555188068.1447182442675
Content-Type: multipart/alternative;
boundary="----=_Part_785_1651873728.1447182442675"
------=_Part_785_1651873728.1447182442675
Content-Type: text/plain; charset=UTF-8
On Tuesday, November 10, 2015 at 1:31:16 PM UTC-5, Jim Porter wrote:
>
> On 11/10/2015 3:01 AM, Xxxx Yyyy wrote:
> > ... so a user familiar
> >
> > with any of these would likely conclude - correctly - that
> > std::is_signed only applies to built-in arithmetic types.
> >
> > That is exactly my point: a user, *familiar with any of these*...
>
> If a user isn't familiar with *any* of the type traits, they probably
> shouldn't be trying to use them. Attempting to use an API you're
> completely unfamiliar with and not reading the docs is a recipe for
> failure.
>
> As other people in this thread have mentioned, is_signed is just an
> abbreviated name for "is_signed_arithmetic". Since enums aren't
> arithmetic types, is_signed must therefore be false. While this naming
> might be slightly awkward to users unfamiliar with the conventions in
> <type_traits>, I think the current behavior is more useful than your
> proposed behavior.
>
> I'm much more likely to care about whether an arithmetic type is signed
> than whether an enum is signed. It's true that I could achieve the
> former with std::is_arithmetic && std::is_signed, but I don't think the
> extra verbosity would be worth it, given how little I care about
> signedness of an enum.
>
> - Jim
>
>
That's actually a very good point. What exactly would someone be able to
accomplish by detecting if an enum is signed?
You can't safely static_cast an integer to the enum type without knowing
beforehand that the integer will fit into the underlying enum type. You
can't safely static_cast from an enum type without knowing that the integer
you're casting to can hold all legal values of the enumeration.
So why ask the question?
--
---
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_785_1651873728.1447182442675
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Tuesday, November 10, 2015 at 1:31:16 PM UTC-5, Jim Porter wrote:<blockq=
uote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-lef=
t: 1px #ccc solid;padding-left: 1ex;">On 11/10/2015 3:01 AM, Xxxx Yyyy wrot=
e:
<br>> ... so a user familiar
<br>>
<br>> =C2=A0 =C2=A0 with any of these would likely conclude - correctly =
- that
<br>> =C2=A0 =C2=A0 std::is_signed only applies to built-in arithmetic t=
ypes.
<br>>
<br>> That is exactly my point: a user, *familiar with any of these*...
<br>
<br>If a user isn't familiar with *any* of the type traits, they probab=
ly=20
<br>shouldn't be trying to use them. Attempting to use an API you'r=
e=20
<br>completely unfamiliar with and not reading the docs is a recipe for fai=
lure.
<br>
<br>As other people in this thread have mentioned, is_signed is just an=20
<br>abbreviated name for "is_signed_arithmetic". Since enums aren=
't=20
<br>arithmetic types, is_signed must therefore be false. While this naming=
=20
<br>might be slightly awkward to users unfamiliar with the conventions in=
=20
<br><type_traits>, I think the current behavior is more useful than y=
our=20
<br>proposed behavior.
<br>
<br>I'm much more likely to care about whether an arithmetic type is si=
gned=20
<br>than whether an enum is signed. It's true that I could achieve the=
=20
<br>former with std::is_arithmetic && std::is_signed, but I don'=
;t think the=20
<br>extra verbosity would be worth it, given how little I care about=20
<br>signedness of an enum.
<br>
<br>- Jim
<br>
<br></blockquote><div><br>That's actually a very good point. What exact=
ly would someone be able to accomplish by detecting if an enum is signed?<b=
r><br>You can't safely static_cast an integer to the enum type without =
knowing beforehand that the integer will fit into the underlying enum type.=
You can't safely static_cast from an enum type without knowing that th=
e integer you're casting to can hold all legal values of the enumeratio=
n.<br><br>So why ask the question?<br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_785_1651873728.1447182442675--
------=_Part_784_555188068.1447182442675--
.
Author: "'Matt Calabrese' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Tue, 10 Nov 2015 11:08:24 -0800
Raw View
--001a113cf57c2016d90524346fd1
Content-Type: text/plain; charset=UTF-8
On Mon, Nov 9, 2015 at 11:32 PM, Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
wrote:
> But isn't it *completely counter intuitive*, that a type which is based
> on a signed type suddenly looses its "signedness" just because its an enum?
>
I see a lot lately of people subjectively finding a facility "not
intuitive" and using it as a means to claim that the abstraction is
incorrect or that it needs to be expanded. That an individual personally
finds something unintuitive is not evidence for the abstraction being
incorrect. Maybe the name of the facility is misleading to some, I'll grant
you that, but the behavior that it provides is consistent with what is
expected out of those who use it, and I also don't quite see the utility of
the facility that you provide. If someone who is new to type traits doesn't
know what std::is_signed is actually for and they use it without reading
the documentation, assuming behavior that it doesn't provide, then that's
not a problem with the facility.
--
---
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/.
--001a113cf57c2016d90524346fd1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On M=
on, Nov 9, 2015 at 11:32 PM, Xxxx Yyyy <span dir=3D"ltr"><<a href=3D"mai=
lto:hermann.fuerntratt@joanneum.at" target=3D"_blank">hermann.fuerntratt@jo=
anneum.at</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(20=
4,204,204);border-left-style:solid;padding-left:1ex"><div dir=3D"ltr"><div>=
<div class=3D"gmail_quote"><div>But isn't it <i><b>completely counter i=
ntuitive</b></i>, that a type which is based on a signed type suddenly loos=
es its "signedness" just because its an enum?</div></div></div></=
div></blockquote><div><br></div><div>I see a lot lately of people subjectiv=
ely finding a facility "not intuitive" and using it as a means to=
claim that the abstraction is incorrect or that it needs to be expanded. T=
hat an individual personally finds something unintuitive is not evidence fo=
r the abstraction being incorrect. Maybe the name of the facility is mislea=
ding to some, I'll grant you that, but the behavior that it provides is=
consistent with what is expected out of those who use it, and I also don&#=
39;t quite see the utility of the facility that you provide. If someone who=
is new to type traits doesn't know what std::is_signed is actually for=
and they use it without reading the documentation, assuming behavior that =
it doesn't provide, then that's not a problem with the facility.</d=
iv></div></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" 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 />
--001a113cf57c2016d90524346fd1--
.
Author: Myriachan <myriachan@gmail.com>
Date: Tue, 10 Nov 2015 11:20:18 -0800 (PST)
Raw View
------=_Part_2882_1221684534.1447183218748
Content-Type: multipart/alternative;
boundary="----=_Part_2883_1090649103.1447183218748"
------=_Part_2883_1090649103.1447183218748
Content-Type: text/plain; charset=UTF-8
On Tuesday, November 10, 2015 at 10:31:16 AM UTC-8, Jim Porter wrote:
>
> As other people in this thread have mentioned, is_signed is just an
> abbreviated name for "is_signed_arithmetic".
>
It's actually not. On most modern systems, std::uint16_t has *signed*
arithmetic, thanks to the promotion rules, despite being an unsigned
integer type.
Try this with -fsanitize=undefined in Clang:
#include <cstdint>
int main()
{
std::uint16_t x = 0xFFFFu;
x *= x;
return x;
}
Melissa
--
---
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_2883_1090649103.1447183218748
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On Tuesday, November 10, 2015 at 10:31:16 AM UTC-8, Jim Po=
rter wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left=
: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">As other people in =
this thread have mentioned, is_signed is just an=20
<br>abbreviated name for "is_signed_arithmetic".<br></blockquote>=
<div><br>It's actually not.=C2=A0 On most modern systems, <span style=
=3D"font-family: courier new,monospace;">std::uint16_t</span> has <i>signed=
</i> arithmetic, thanks to the promotion rules, despite being an unsigned i=
nteger type.<br><br>Try this with <span style=3D"font-family: courier new,m=
onospace;">-fsanitize=3Dundefined</span> in Clang:<br><br><div class=3D"pre=
ttyprint" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(=
187, 187, 187); border-style: solid; border-width: 1px; word-wrap: break-wo=
rd;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=
=3D"color: #800;" class=3D"styled-by-prettify">#include</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #080;" class=3D"styled-by-prettify"><cstdint></span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"><br><br></span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">int</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> main</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">()</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"><br></span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"><br>=C2=A0 =C2=A0 std</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">uint16_t x </span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">0xFFFF=
u</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =
x </span><span style=3D"color: #660;" class=3D"styled-by-prettify">*=3D</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> x</span><span=
style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span =
style=3D"color: #008;" class=3D"styled-by-prettify">return</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> x</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br></span></div></code></div><br>Melissa<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" 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_2883_1090649103.1447183218748--
------=_Part_2882_1221684534.1447183218748--
.
Author: "'Matt Calabrese' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Tue, 10 Nov 2015 11:28:05 -0800
Raw View
--001a1134f1d87b1a8d052434b58c
Content-Type: text/plain; charset=UTF-8
On Tue, Nov 10, 2015 at 11:20 AM, Myriachan <myriachan@gmail.com> wrote:
> On Tuesday, November 10, 2015 at 10:31:16 AM UTC-8, Jim Porter wrote:
>>
>> As other people in this thread have mentioned, is_signed is just an
>> abbreviated name for "is_signed_arithmetic".
>>
>
> It's actually not. On most modern systems, std::uint16_t has *signed*
> arithmetic, thanks to the promotion rules, despite being an unsigned
> integer type.
>
"Arithmetic" when talking about types in C++ is the adjective, as opposed
to the noun (accent on the third syllable as opposed to the second :p). In
other words, is_signed_arithmetic is short for is_signed_arithmetic_type.
It would check if the type is an arithmetic type that can represent
negative values.
--
---
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/.
--001a1134f1d87b1a8d052434b58c
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On T=
ue, Nov 10, 2015 at 11:20 AM, Myriachan <span dir=3D"ltr"><<a href=3D"ma=
ilto:myriachan@gmail.com" target=3D"_blank">myriachan@gmail.com</a>></sp=
an> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><span class=
=3D"">On Tuesday, November 10, 2015 at 10:31:16 AM UTC-8, Jim Porter wrote:=
<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;borde=
r-left:1px #ccc solid;padding-left:1ex">As other people in this thread have=
mentioned, is_signed is just an=20
<br>abbreviated name for "is_signed_arithmetic".<br></blockquote>=
</span><div><br>It's actually not.=C2=A0 On most modern systems, <span =
style=3D"font-family:courier new,monospace">std::uint16_t</span> has <i>sig=
ned</i> arithmetic, thanks to the promotion rules, despite being an unsigne=
d integer type.</div></div></blockquote><div><br></div><div>"Arithmeti=
c" when talking about types in C++ is the adjective, as opposed to the=
noun (accent on the third syllable as opposed to the second :p). In other =
words, is_signed_arithmetic is short for is_signed_arithmetic_type. It woul=
d check if the type is an arithmetic type that can represent negative value=
s.</div></div></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" 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 />
--001a1134f1d87b1a8d052434b58c--
.
Author: Jim Porter <jvp4846@g.rit.edu>
Date: Tue, 10 Nov 2015 14:20:48 -0600
Raw View
On 11/10/2015 1:28 PM, 'Matt Calabrese' via ISO C++ Standard - Future
Proposals wrote:
> "Arithmetic" when talking about types in C++ is the adjective, as
> opposed to the noun (accent on the third syllable as opposed to the
> second :p). In other words, is_signed_arithmetic is short for
> is_signed_arithmetic_type. It would check if the type is an arithmetic
> type that can represent negative values.
Funnily, I wrote "is_signed_arithmetic_type" first, but then I
reconsidered, since I thought it sounded too much like it would *return*
a type instead of inspecting a type.
- Jim
--
---
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/.
.
Author: Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
Date: Tue, 10 Nov 2015 23:18:14 -0800 (PST)
Raw View
------=_Part_7400_1944587802.1447226295034
Content-Type: multipart/alternative;
boundary="----=_Part_7401_1063206413.1447226295034"
------=_Part_7401_1063206413.1447226295034
Content-Type: text/plain; charset=UTF-8
Because other "built in" operations don't apply to enums, even if they
apply
> to the underlying type.
>
>
>
enum E : signed char {a=-1};
sizeof(E) ?
--
---
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_7401_1063206413.1447226295034
Content-Type: text/html; charset=UTF-8
<div dir="ltr">Because other "built in" operations don't apply to enums, even if they apply
<br><blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">to the underlying type.
<br>
<br><br></blockquote><div><br>enum E : signed char {a=-1};<br>sizeof(E) ?<br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />
------=_Part_7401_1063206413.1447226295034--
------=_Part_7400_1944587802.1447226295034--
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Wed, 11 Nov 2015 00:08:13 -0800
Raw View
On Tuesday 10 November 2015 23:18:14 Xxxx Yyyy wrote:
> Because other "built in" operations don't apply to enums, even if they
> apply
>
> > to the underlying type.
>
> enum E : signed char {a=-1};
> sizeof(E) ?
That's not an arithmetic operation and E is not a strongly-typed enum either.
Try this:
enum class E : signed char { a = -1 };
E e = E::a;
++e;
e + 1;
e * 2;
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--
---
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/.
.
Author: Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
Date: Wed, 11 Nov 2015 00:11:57 -0800 (PST)
Raw View
------=_Part_7001_861467319.1447229517259
Content-Type: multipart/alternative;
boundary="----=_Part_7002_1050801814.1447229517259"
------=_Part_7002_1050801814.1447229517259
Content-Type: text/plain; charset=UTF-8
So, stepping back and looking at the pros and cons that
enum E : signed int { Val = -1 };
std::is_signed<E>::value = ?
should return true instead of false,
the cons may be summarised to
- Changing the semantics of is_signed<> is hard, as it may break a lot
of existing code
- The meaning of is_signed<> is correct, as people who know about the
typical behaviour of type_traits "functions" are aware of it
- We don't need to change it, cause it's just a single person (me), that
finds that behaviour surprising
- User, who don't know about the restricted semantics of is_signed<>
should not use type_traits
- People should read the documentation, before they start programming
on the pro side
- As I stated at the beginning: from the technical point of view, the
behaviour is totally correct according to the standard, but from the
logical point of view it is not
- For an API being intuitive is - in my humble opinion - 1000 times more
worth than being a standard, as it saves money; if the semantics of a
function is clear, I don't need to read the documentation. If the semantics
is unclear, reading the docs costs time. Time that stopps me being in the
flow. Time that stopps me solving the real problems. There is a paper from
Matthias Ettrich, the founder of KDE and mastermind of Qt about what in his
opinion a good API should be (
https://wiki.qt.io/API_Design_Principles) In short, a good API should
be:
1) minimal
2) complete
3) should have clear and simple semantics
4) be intuitive
5) easy to memorise
6) should lead to readable code.
Especially being intuitive is defined as:
"An API is intuitive if a semi-experienced user gets away without
reading the documentation, and if a programmer who doesn't know the API can
understand code written using it."
--
---
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_7002_1050801814.1447229517259
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">So, stepping back and looking at the pros and cons that <b=
r><br><div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 2=
50); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1=
px; word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subpr=
ettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettify">enum</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> E </span><s=
pan 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">signed</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
</span><span style=3D"color: #606;" class=3D"styled-by-prettify">Val</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">-</span><span style=3D"color: #066;" clas=
s=3D"styled-by-prettify">1</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">};</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><=
br>std</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify">is_signed</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify"><</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify">E</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">>::</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">value </span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">?</span></div></code></div><br>should return true i=
nstead of false,<br><br>the cons may be summarised to<br><ul><li>Changing t=
he semantics of is_signed<> is hard, as it may break a lot of existin=
g code<br></li><li>The meaning of is_signed<> is correct, as people w=
ho know about the typical behaviour of type_traits "functions" ar=
e aware of it</li><li>We don't need to change it, cause it's just a=
single person (me), that finds that behaviour surprising<br></li><li>User,=
who don't know about the restricted semantics of is_signed<> sho=
uld not use type_traits</li><li>People should read the documentation, befor=
e they start programming</li></ul><p>on the pro side</p><ul><li>As I stated=
at the beginning: from the technical point of view, the behaviour is total=
ly correct according to the standard, but from the logical point of view it=
is not</li><li>For an API being intuitive is - in my humble opinion - 1000=
times more worth than being a standard, as it saves money; if the semantic=
s of a function is clear, I don't need to read the documentation. If th=
e semantics is unclear, reading the docs costs time. Time that stopps me be=
ing in the flow. Time that stopps me solving the real problems. There is a =
paper from Matthias Ettrich, the founder of KDE and mastermind of Qt about =
what in his opinion a good API should be (<p class=3D"MsoNormal"><span styl=
e=3D"font-size:9.0pt;font-family:"Verdana","sans-serif"=
;
mso-fareast-font-family:"Times New Roman""><a href=3D"https://wik=
i.qt.io/API_Design_Principles">https://wiki.qt.io/API_Design_Principles</a>=
</span>) In short, a good API should be: <br>1) minimal<br>2) complete<br>3=
) should have clear and simple semantics<br>4) be intuitive<br>5) easy to m=
emorise<br>6) should lead to readable code.<br>Especially being intuitive i=
s defined as:<br>"An API is intuitive if a semi-experienced user gets =
away without reading
the documentation, and if a programmer who doesn't know the API can=20
understand code written using it."</p></li></ul><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_7002_1050801814.1447229517259--
------=_Part_7001_861467319.1447229517259--
.
Author: Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
Date: Wed, 11 Nov 2015 00:13:24 -0800 (PST)
Raw View
------=_Part_6822_999366412.1447229604322
Content-Type: multipart/alternative;
boundary="----=_Part_6823_963989392.1447229604322"
------=_Part_6823_963989392.1447229604322
Content-Type: text/plain; charset=UTF-8
Am Mittwoch, 11. November 2015 09:08:18 UTC+1 schrieb Thiago Macieira:
>
> On Tuesday 10 November 2015 23:18:14 Xxxx Yyyy wrote:
> > Because other "built in" operations don't apply to enums, even if they
> > apply
> >
> > > to the underlying type.
> >
> > enum E : signed char {a=-1};
> > sizeof(E) ?
>
> That's not an arithmetic operation and E is not a strongly-typed enum
> either.
>
> Try this:
>
> enum class E : signed char { a = -1 };
> E e = E::a;
>
> ++e;
> e + 1;
> e * 2;
>
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> Software Architect - Intel Open Source Technology Center
> PGP/GPG: 0x6EF45358; fingerprint:
> E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
>
Why on earth, would you try to do such things with enums??
--
---
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_6823_963989392.1447229604322
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<br><br>Am Mittwoch, 11. November 2015 09:08:18 UTC+1 schrieb Thiago Maciei=
ra:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;=
border-left: 1px #ccc solid;padding-left: 1ex;">On Tuesday 10 November 2015=
23:18:14 Xxxx Yyyy wrote:
<br>> Because other "built in" operations don't apply to e=
nums, even if they
<br>> apply
<br>>=20
<br>> > to the underlying type.
<br>>=20
<br>> enum E : signed char {a=3D-1};
<br>> sizeof(E) ?
<br>
<br>That's not an arithmetic operation and E is not a strongly-typed en=
um either.
<br>
<br>Try this:
<br>
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0enum class E : signed c=
har { a =3D -1 };
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0E e =3D E::a;
<br>
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0++e;
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0e + 1;
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0e * 2;
<br>
<br>
<br>--=20
<br>Thiago Macieira - thiago (AT) <a href=3D"http://macieira.info" target=
=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D'http://www.goo=
gle.com/url?q\75http%3A%2F%2Fmacieira.info\46sa\75D\46sntz\0751\46usg\75AFQ=
jCNEswDUBNCNanbu7euhqLn_62FW8ag';return true;" onclick=3D"this.href=3D&=
#39;http://www.google.com/url?q\75http%3A%2F%2Fmacieira.info\46sa\75D\46snt=
z\0751\46usg\75AFQjCNEswDUBNCNanbu7euhqLn_62FW8ag';return true;">maciei=
ra.info</a> - thiago (AT) <a href=3D"http://kde.org" target=3D"_blank" rel=
=3D"nofollow" onmousedown=3D"this.href=3D'http://www.google.com/url?q\7=
5http%3A%2F%2Fkde.org\46sa\75D\46sntz\0751\46usg\75AFQjCNHGRJdo5_JYG1Dowztw=
AHAKs80XSA';return true;" onclick=3D"this.href=3D'http://www.google=
..com/url?q\75http%3A%2F%2Fkde.org\46sa\75D\46sntz\0751\46usg\75AFQjCNHGRJdo=
5_JYG1DowztwAHAKs80XSA';return true;">kde.org</a>
<br>=C2=A0 =C2=A0Software Architect - Intel Open Source Technology Center
<br>=C2=A0 =C2=A0 =C2=A0 PGP/GPG: 0x6EF45358; fingerprint:
<br>=C2=A0 =C2=A0 =C2=A0 E067 918B B660 DBD1 105C =C2=A0966C 33F5 F005 6EF4=
5358
<br></blockquote><div><br>Why on earth, would you try to do such things wit=
h enums??<br>=C2=A0</div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_6823_963989392.1447229604322--
------=_Part_6822_999366412.1447229604322--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Wed, 11 Nov 2015 05:36:48 -0800 (PST)
Raw View
------=_Part_471_1411156150.1447249008283
Content-Type: multipart/alternative;
boundary="----=_Part_472_317648720.1447249008284"
------=_Part_472_317648720.1447249008284
Content-Type: text/plain; charset=UTF-8
On Wednesday, November 11, 2015 at 3:13:24 AM UTC-5, Xxxx Yyyy wrote:
>
> Am Mittwoch, 11. November 2015 09:08:18 UTC+1 schrieb Thiago Macieira:
>>
>> On Tuesday 10 November 2015 23:18:14 Xxxx Yyyy wrote:
>> > Because other "built in" operations don't apply to enums, even if they
>> > apply
>> >
>> > > to the underlying type.
>> >
>> > enum E : signed char {a=-1};
>> > sizeof(E) ?
>>
>> That's not an arithmetic operation and E is not a strongly-typed enum
>> either.
>>
>> Try this:
>>
>> enum class E : signed char { a = -1 };
>> E e = E::a;
>>
>> ++e;
>> e + 1;
>> e * 2;
>>
>>
>> --
>> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>> Software Architect - Intel Open Source Technology Center
>> PGP/GPG: 0x6EF45358; fingerprint:
>> E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
>>
>
> Why on earth, would you try to do such things with enums??
>
That's a very good question. An even better question is why you want to try
to use `is_signed` with an enum.
--
---
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_472_317648720.1447249008284
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Wednesday, November 11, 2015 at 3:13:24 AM UTC-5, Xxxx Yyyy wrote:<block=
quote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-le=
ft: 1px #ccc solid;padding-left: 1ex;">Am Mittwoch, 11. November 2015 09:08=
:18 UTC+1 schrieb Thiago Macieira:<blockquote class=3D"gmail_quote" style=
=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"=
>On Tuesday 10 November 2015 23:18:14 Xxxx Yyyy wrote:
<br>> Because other "built in" operations don't apply to e=
nums, even if they
<br>> apply
<br>>=20
<br>> > to the underlying type.
<br>>=20
<br>> enum E : signed char {a=3D-1};
<br>> sizeof(E) ?
<br>
<br>That's not an arithmetic operation and E is not a strongly-typed en=
um either.
<br>
<br>Try this:
<br>
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0enum class E : signed c=
har { a =3D -1 };
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0E e =3D E::a;
<br>
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0++e;
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0e + 1;
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0e * 2;
<br>
<br>
<br>--=20
<br>Thiago Macieira - thiago (AT) <a href=3D"http://macieira.info" rel=3D"n=
ofollow" target=3D"_blank" onmousedown=3D"this.href=3D'http://www.googl=
e.com/url?q\75http%3A%2F%2Fmacieira.info\46sa\75D\46sntz\0751\46usg\75AFQjC=
NEswDUBNCNanbu7euhqLn_62FW8ag';return true;" onclick=3D"this.href=3D=
9;http://www.google.com/url?q\75http%3A%2F%2Fmacieira.info\46sa\75D\46sntz\=
0751\46usg\75AFQjCNEswDUBNCNanbu7euhqLn_62FW8ag';return true;">macieira=
..info</a> - thiago (AT) <a href=3D"http://kde.org" rel=3D"nofollow" target=
=3D"_blank" onmousedown=3D"this.href=3D'http://www.google.com/url?q\75h=
ttp%3A%2F%2Fkde.org\46sa\75D\46sntz\0751\46usg\75AFQjCNHGRJdo5_JYG1DowztwAH=
AKs80XSA';return true;" onclick=3D"this.href=3D'http://www.google.c=
om/url?q\75http%3A%2F%2Fkde.org\46sa\75D\46sntz\0751\46usg\75AFQjCNHGRJdo5_=
JYG1DowztwAHAKs80XSA';return true;">kde.org</a>
<br>=C2=A0 =C2=A0Software Architect - Intel Open Source Technology Center
<br>=C2=A0 =C2=A0 =C2=A0 PGP/GPG: 0x6EF45358; fingerprint:
<br>=C2=A0 =C2=A0 =C2=A0 E067 918B B660 DBD1 105C =C2=A0966C 33F5 F005 6EF4=
5358
<br></blockquote><div><br>Why on earth, would you try to do such things wit=
h enums??</div></blockquote><div><br>That's a very good question. An ev=
en better question is why you want to try to use `is_signed` with an enum. =
<br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_472_317648720.1447249008284--
------=_Part_471_1411156150.1447249008283--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Wed, 11 Nov 2015 05:44:23 -0800 (PST)
Raw View
------=_Part_7459_1959603415.1447249463447
Content-Type: multipart/alternative;
boundary="----=_Part_7460_861092168.1447249463447"
------=_Part_7460_861092168.1447249463447
Content-Type: text/plain; charset=UTF-8
On Wednesday, November 11, 2015 at 3:11:57 AM UTC-5, Xxxx Yyyy wrote:
>
> So, stepping back and looking at the pros and cons that
>
> enum E : signed int { Val = -1 };
> std::is_signed<E>::value = ?
>
> should return true instead of false,
>
> the cons may be summarised to
>
> - Changing the semantics of is_signed<> is hard, as it may break a lot
> of existing code
> - The meaning of is_signed<> is correct, as people who know about the
> typical behaviour of type_traits "functions" are aware of it
> - We don't need to change it, cause it's just a single person (me),
> that finds that behaviour surprising
> - User, who don't know about the restricted semantics of is_signed<>
> should not use type_traits
> - People should read the documentation, before they start programming
>
> If you're listing all the cons, where is "it serves no useful purpose" on
that list?
Show me a piece of genuinely useful code that does a metaprogramming test
on an enumeration and will behave differently if the underlying type is
signed or unsigned. I want to see where this functionality would be useful.
And no, that thing you posted earlier does not qualify. I want to know *why*
you need to test whether the enum is signed. What do you plan to do once
you know if it's signed or not?
> on the pro side
>
> - As I stated at the beginning: from the technical point of view, the
> behaviour is totally correct according to the standard, but from the
> logical point of view it is not
>
>
No, the behavior you want is not "totally correct according to the
standard". You keep missing the important point here: an enumeration is *not
its underlying type*. Just as a struct is not a data member. `struct foo {
int bar;}` is neither signed nor unsigned. Just as `enum foo : int {};` is
neither signed nor unsigned.
The underlying type of an enum may be signed or unsigned, but not the enum
itself. Just like a member of a struct may be signed or unsigned, but not
the struct itself.
>
> - For an API being intuitive is - in my humble opinion - 1000 times
> more worth than being a standard, as it saves money; if the semantics of a
> function is clear, I don't need to read the documentation. If the semantics
> is unclear, reading the docs costs time. Time that stopps me being in the
> flow. Time that stopps me solving the real problems. There is a paper from
> Matthias Ettrich, the founder of KDE and mastermind of Qt about what in his
> opinion a good API should be (
>
> https://wiki.qt.io/API_Design_Principles) In short, a good API should
> be:
> 1) minimal
> 2) complete
> 3) should have clear and simple semantics
> 4) be intuitive
> 5) easy to memorise
> 6) should lead to readable code.
> Especially being intuitive is defined as:
> "An API is intuitive if a semi-experienced user gets away without
> reading the documentation, and if a programmer who doesn't know the API can
> understand code written using it."
>
> That's a nice argument, but it's contingent on us believing that
`is_signed`'s behavior is actually unintuitive. Which you have yet to
adequately demonstrate. Just because you expected it to work with an enum
type doesn't mean it's unintuitive.
--
---
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_7460_861092168.1447249463447
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Wednesday, November 11, 2015 at 3:11:57 AM UTC-5, Xxxx Yyyy wrote:<block=
quote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-le=
ft: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">So, stepping back a=
nd looking at the pros and cons that <br><br><div style=3D"background-color=
:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-w=
idth:1px;word-wrap:break-word"><code><div><span style=3D"color:#008">enum</=
span><span style=3D"color:#000"> E </span><span style=3D"color:#660">:</spa=
n><span style=3D"color:#000"> </span><span style=3D"color:#008">signed</spa=
n><span style=3D"color:#000"> </span><span style=3D"color:#008">int</span><=
span style=3D"color:#000"> </span><span style=3D"color:#660">{</span><span =
style=3D"color:#000"> </span><span style=3D"color:#606">Val</span><span sty=
le=3D"color:#000"> </span><span style=3D"color:#660">=3D</span><span style=
=3D"color:#000"> </span><span style=3D"color:#660">-</span><span style=3D"c=
olor:#066">1</span><span style=3D"color:#000"> </span><span style=3D"color:=
#660">};</span><span style=3D"color:#000"><br>std</span><span style=3D"colo=
r:#660">::</span><span style=3D"color:#000">is_signed</span><span style=3D"=
color:#660"><</span><span style=3D"color:#000">E</span><span style=3D"co=
lor:#660">>::</span><span style=3D"color:#000">value </span><span style=
=3D"color:#660">=3D</span><span style=3D"color:#000"> </span><span style=3D=
"color:#660">?</span></div></code></div><br>should return true instead of f=
alse,<br><br>the cons may be summarised to<br><ul><li>Changing the semantic=
s of is_signed<> is hard, as it may break a lot of existing code<br><=
/li><li>The meaning of is_signed<> is correct, as people who know abo=
ut the typical behaviour of type_traits "functions" are aware of =
it</li><li>We don't need to change it, cause it's just a single per=
son (me), that finds that behaviour surprising<br></li><li>User, who don=
9;t know about the restricted semantics of is_signed<> should not use=
type_traits</li><li>People should read the documentation, before they star=
t programming</li></ul></div></blockquote><div>If you're listing all th=
e cons, where is "it serves no useful purpose" on that list?<br><=
br>Show me a piece of genuinely useful code that does a metaprogramming tes=
t on an enumeration and will behave differently if the underlying type is s=
igned or unsigned. I want to see where this functionality would be useful.<=
br><br>And no, that thing you posted earlier does not qualify. I want to kn=
ow <i>why</i> you need to test whether the enum is signed. What do you plan=
to do once you know if it's signed or not?<br>=C2=A0</div><blockquote =
class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1p=
x #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><p>on the pro side</p><ul=
><li>As I stated at the beginning: from the technical point of view, the be=
haviour is totally correct according to the standard, but from the logical =
point of view it is not</li></ul></div></blockquote><div><br>No, the behavi=
or you want is not "totally correct according to the standard". Y=
ou keep missing the important point here: an enumeration is <i>not its unde=
rlying type</i>. Just as a struct is not a data member. `struct foo { int b=
ar;}` is neither signed nor unsigned. Just as `enum foo : int {};` is neith=
er signed nor unsigned.<br><br>The underlying type of an enum may be signed=
or unsigned, but not the enum itself. Just like a member of a struct may b=
e signed or unsigned, but not the struct itself.<br>=C2=A0</div><blockquote=
class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1=
px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><ul><li>For an API being=
intuitive is - in my humble opinion - 1000 times more worth than being a s=
tandard, as it saves money; if the semantics of a function is clear, I don&=
#39;t need to read the documentation. If the semantics is unclear, reading =
the docs costs time. Time that stopps me being in the flow. Time that stopp=
s me solving the real problems. There is a paper from Matthias Ettrich, the=
founder of KDE and mastermind of Qt about what in his opinion a good API s=
hould be (<p class=3D"MsoNormal"><span style=3D"font-size:9.0pt;font-family=
:"Verdana","sans-serif""><a href=3D"https://wiki.qt.io/=
API_Design_Principles" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"th=
is.href=3D'https://www.google.com/url?q\75https%3A%2F%2Fwiki.qt.io%2FAP=
I_Design_Principles\46sa\75D\46sntz\0751\46usg\75AFQjCNGcI-mXYvUi2de7HePAdq=
HvcOZF4g';return true;" onclick=3D"this.href=3D'https://www.google.=
com/url?q\75https%3A%2F%2Fwiki.qt.io%2FAPI_Design_Principles\46sa\75D\46snt=
z\0751\46usg\75AFQjCNGcI-mXYvUi2de7HePAdqHvcOZF4g';return true;">https:=
//wiki.qt.io/API_Design_<wbr>Principles</a></span>) In short, a good API sh=
ould be: <br>1) minimal<br>2) complete<br>3) should have clear and simple s=
emantics<br>4) be intuitive<br>5) easy to memorise<br>6) should lead to rea=
dable code.<br>Especially being intuitive is defined as:<br>"An API is=
intuitive if a semi-experienced user gets away without reading
the documentation, and if a programmer who doesn't know the API can=20
understand code written using it."</p></li></ul></div></blockquote><di=
v>That's a nice argument, but it's contingent on us believing that =
`is_signed`'s behavior is actually unintuitive. Which you have yet to a=
dequately demonstrate. Just because you expected it to work with an enum ty=
pe doesn't mean it's unintuitive.<br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_7460_861092168.1447249463447--
------=_Part_7459_1959603415.1447249463447--
.
Author: Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
Date: Wed, 11 Nov 2015 06:11:17 -0800 (PST)
Raw View
------=_Part_7517_2090494754.1447251077428
Content-Type: multipart/alternative;
boundary="----=_Part_7518_354831087.1447251077428"
------=_Part_7518_354831087.1447251077428
Content-Type: text/plain; charset=UTF-8
No, the behavior you want is not "totally correct according to the
> standard". You keep missing the important point here: an enumeration is *not
> its underlying type*. Just as a struct is not a data member. `struct foo
> { int bar;}` is neither signed nor unsigned. Just as `enum foo : int {};`
> is neither signed nor unsigned.
>
I just wonder, why no one here is talking about
std::is_class<>
as it returns true for structs as well, although a struct is definitely not
a class.
Ever thought about this?
--
---
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_7518_354831087.1447251077428
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div><br><blockquote style=3D"margin: 0px 0px 0px 0.8e=
x; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class=3D"=
gmail_quote">=C2=A0No, the behavior you want is not "totally correct a=
ccording to the=20
standard". You keep missing the important point here: an enumeration i=
s <i>not its underlying type</i>.
Just as a struct is not a data member. `struct foo { int bar;}` is=20
neither signed nor unsigned. Just as `enum foo : int {};` is neither=20
signed nor unsigned.<br></blockquote><div><br>I just wonder, why no one her=
e is talking about <br>std::is_class<> <br>as it returns true for str=
ucts as well, although a struct is definitely not a class.<br>Ever thought =
about this?<br></div></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" 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_7518_354831087.1447251077428--
------=_Part_7517_2090494754.1447251077428--
.
Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Wed, 11 Nov 2015 09:18:50 -0500
Raw View
On 2015-11-11 08:44, Nicol Bolas wrote:
> Show me a piece of genuinely useful code that does a metaprogramming test
> on an enumeration and will behave differently if the underlying type is
> signed or unsigned. I want to see where this functionality would be useful.
I would propose that even that is insufficient. Such code *must work
equally on integral and enum types*. If it only works on enum types,
then it should be using std::underlying_type rather than hoping to
shortcut it.
--
Matthew
--
---
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/.
.
Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Wed, 11 Nov 2015 09:24:23 -0500
Raw View
On 2015-11-11 09:11, Xxxx Yyyy wrote:
> I just wonder, why no one here is talking about=20
> std::is_class<>=20
> as it returns true for structs as well, although a struct is definitely n=
ot=20
> a class.
> Ever thought about this?
No one is talking about it because a struct *is* a class. There is
exactly *one* "difference" between a struct and a class. Members and
base classes of a struct are public unless otherwise qualified, while
for a class they are private unless otherwise qualified. That's *it*=C2=B9.
In all other ways they are the same, behave the same, support the same
features, etc.
(=C2=B9 Okay, that and strange mangling conventions on e.g. MSVC.)
--=20
Matthew
--=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: Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
Date: Wed, 11 Nov 2015 06:31:13 -0800 (PST)
Raw View
------=_Part_7498_400280038.1447252273574
Content-Type: multipart/alternative;
boundary="----=_Part_7499_237778018.1447252273581"
------=_Part_7499_237778018.1447252273581
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Am Mittwoch, 11. November 2015 15:27:15 UTC+1 schrieb Matthew Woehlke:
>
> On 2015-11-11 09:11, Xxxx Yyyy wrote:=20
> > I just wonder, why no one here is talking about=20
> > std::is_class<>=20
> > as it returns true for structs as well, although a struct is definitely=
=20
> not=20
> > a class.=20
> > Ever thought about this?=20
>
> No one is talking about it because a struct *is* a class. There is=20
> exactly *one* "difference" between a struct and a class. Members and=20
> base classes of a struct are public unless otherwise qualified, while=20
> for a class they are private unless otherwise qualified. That's *it*=C2=
=B9.=20
> In all other ways they are the same, behave the same, support the same=20
> features, etc.=20
>
> (=C2=B9 Okay, that and strange mangling conventions on e.g. MSVC.)=20
>
> --=20
> Matthew=20
>
So there is a difference, although they are identical... sounds a little=
=20
bit strange...
--=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/.
------=_Part_7499_237778018.1447252273581
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>Am Mittwoch, 11. November 2015 15:27:15 UTC+1 schr=
ieb Matthew Woehlke:<blockquote class=3D"gmail_quote" style=3D"margin: 0;ma=
rgin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On 2015-11=
-11 09:11, Xxxx Yyyy wrote:
<br>> I just wonder, why no one here is talking about=20
<br>> std::is_class<>=20
<br>> as it returns true for structs as well, although a struct is defin=
itely not=20
<br>> a class.
<br>> Ever thought about this?
<br>
<br>No one is talking about it because a struct *is* a class. There is
<br>exactly *one* "difference" between a struct and a class. Memb=
ers and
<br>base classes of a struct are public unless otherwise qualified, while
<br>for a class they are private unless otherwise qualified. That's *it=
*=C2=B9.
<br>In all other ways they are the same, behave the same, support the same
<br>features, etc.
<br>
<br>(=C2=B9 Okay, that and strange mangling conventions on e.g. MSVC.)
<br>
<br>--=20
<br>Matthew
<br></blockquote><div><br>=C2=A0So there is a difference, although they are=
identical... sounds a little bit strange...<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" 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_7499_237778018.1447252273581--
------=_Part_7498_400280038.1447252273574--
.
Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Wed, 11 Nov 2015 09:42:59 -0500
Raw View
On 2015-11-11 09:31, Xxxx Yyyy wrote:
>=20
>=20
> Am Mittwoch, 11. November 2015 15:27:15 UTC+1 schrieb Matthew Woehlke:
>>
>> On 2015-11-11 09:11, Xxxx Yyyy wrote:=20
>>> I just wonder, why no one here is talking about=20
>>> std::is_class<>=20
>>> as it returns true for structs as well, although a struct is definitely=
=20
>> not=20
>>> a class.=20
>>> Ever thought about this?=20
>>
>> No one is talking about it because a struct *is* a class. There is=20
>> exactly *one* "difference" between a struct and a class. Members and=20
>> base classes of a struct are public unless otherwise qualified, while=20
>> for a class they are private unless otherwise qualified. That's *it*=C2=
=B9.=20
>> In all other ways they are the same, behave the same, support the same=
=20
>> features, etc.=20
>>
>> (=C2=B9 Okay, that and strange mangling conventions on e.g. MSVC.)=20
>>
>> --=20
>> Matthew=20
>>
>=20
> So there is a difference, although they are identical... sounds a little=
=20
> bit strange...
There is one built-in "product type" in C++, which we'll call "cla=C3=9F" f=
or
disambiguation. std::is_class tells you if a type is a cla=C3=9F.
The struct and class keywords both declare a cla=C3=9F. The difference is
just that "struct" makes members and bases public by default, while
"class" makes members and bases private by default.
IOW:
struct -> cla=C3=9F [[default_access: public]]
class -> cla=C3=9F [[default_access: private]]
Or, alternatively, these are equivalent:
class Foo : /*private*/ Bar { /*private:*/ ... };
struct Foo : private Bar { Private: ... };
--=20
Matthew
--=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: Nicol Bolas <jmckesson@gmail.com>
Date: Wed, 11 Nov 2015 06:43:33 -0800 (PST)
Raw View
------=_Part_8845_706917181.1447253013849
Content-Type: multipart/alternative;
boundary="----=_Part_8846_1807090554.1447253013850"
------=_Part_8846_1807090554.1447253013850
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Wednesday, November 11, 2015 at 9:31:13 AM UTC-5, Xxxx Yyyy wrote:
>
> Am Mittwoch, 11. November 2015 15:27:15 UTC+1 schrieb Matthew Woehlke:
>>
>> On 2015-11-11 09:11, Xxxx Yyyy wrote:=20
>> > I just wonder, why no one here is talking about=20
>> > std::is_class<>=20
>> > as it returns true for structs as well, although a struct is definitel=
y=20
>> not=20
>> > a class.=20
>> > Ever thought about this?=20
>>
>> No one is talking about it because a struct *is* a class. There is=20
>> exactly *one* "difference" between a struct and a class. Members and=20
>> base classes of a struct are public unless otherwise qualified, while=20
>> for a class they are private unless otherwise qualified. That's *it*=C2=
=B9.=20
>> In all other ways they are the same, behave the same, support the same=
=20
>> features, etc.=20
>>
>> (=C2=B9 Okay, that and strange mangling conventions on e.g. MSVC.)=20
>>
>> --=20
>> Matthew=20
>>
>
> So there is a difference, although they are identical... sounds a little=
=20
> bit strange...
>
`is_class` working for a `struct` is perfectly fine for metaprogramming=20
purposes, because the user of the type doesn't need to know or care whether=
=20
it was declared with `class` or `struct`. And I just learned that you're=20
even allowed to do this (at least, the compiler IdeaOne uses allows it):
class A {};
=20
class B
{
friend struct A;
};
So no, there's really no reason for the user of `A` to care whether it's a=
=20
`class` or a `struct`. Not in a metaprogramming context; you need to know=
=20
if you're forward declaring it. But metaprogramming generally doesn't need=
=20
to do that.
--=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/.
------=_Part_8846_1807090554.1447253013850
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Wednesday, November 11, 2015 at 9:31:13 AM UTC-5, Xxxx Yyyy wrote:<block=
quote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-le=
ft: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">Am Mittwoch, 11. No=
vember 2015 15:27:15 UTC+1 schrieb Matthew Woehlke:<blockquote class=3D"gma=
il_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;pa=
dding-left:1ex">On 2015-11-11 09:11, Xxxx Yyyy wrote:
<br>> I just wonder, why no one here is talking about=20
<br>> std::is_class<>=20
<br>> as it returns true for structs as well, although a struct is defin=
itely not=20
<br>> a class.
<br>> Ever thought about this?
<br>
<br>No one is talking about it because a struct *is* a class. There is
<br>exactly *one* "difference" between a struct and a class. Memb=
ers and
<br>base classes of a struct are public unless otherwise qualified, while
<br>for a class they are private unless otherwise qualified. That's *it=
*=C2=B9.
<br>In all other ways they are the same, behave the same, support the same
<br>features, etc.
<br>
<br>(=C2=B9 Okay, that and strange mangling conventions on e.g. MSVC.)
<br>
<br>--=20
<br>Matthew
<br></blockquote><div><br>=C2=A0So there is a difference, although they are=
identical... sounds a little bit strange...<br></div></div></blockquote><d=
iv><br>`is_class` working for a `struct` is perfectly fine for metaprogramm=
ing purposes, because the user of the type doesn't need to know or care=
whether it was declared with `class` or `struct`. And I just learned that =
you're even allowed to do this (at least, the compiler IdeaOne uses all=
ows it):<br><br><div class=3D"prettyprint" style=3D"background-color: rgb(2=
50, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; borde=
r-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div clas=
s=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">class</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
A </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{};</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0<br><=
/span><span style=3D"color: #008;" class=3D"styled-by-prettify">class</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> B<br></span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><sp=
an style=3D"color: #008;" class=3D"styled-by-prettify">friend</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">struct</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> A</span><span style=3D"color: #660;"=
class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"><br></span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">};</span></div></code></div><br>So no, there's really no=
reason for the user of `A` to care whether it's a `class` or a `struct=
`. Not in a metaprogramming context; you need to know if you're forward=
declaring it. But metaprogramming generally doesn't need to do that.<b=
r></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_8846_1807090554.1447253013850--
------=_Part_8845_706917181.1447253013849--
.
Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Wed, 11 Nov 2015 10:00:54 -0500
Raw View
On 2015-11-11 09:43, Nicol Bolas wrote:
> And I just learned that you're
> even allowed to do this (at least, the compiler IdeaOne uses allows it):
>
> class A {};
>
> class B
> {
> friend struct A;
> };
MSVC *accepts* that, but complains about it (you can try it on
http://webcompiler.cloudapp.net/).
> So no, there's really no reason for the user of `A` to care whether it's a
> `class` or a `struct`. Not in a metaprogramming context; you need to know
> if you're forward declaring it. But metaprogramming generally doesn't need
> to do that.
Even for forward declarations it matters only (AFAIK) on MSVC, which
mangles class and struct parameters differently. Every other compiler
AFAIK allows you to mix and match forward declarations as well.
(Warnings in this case don't count, as I am pretty sure they exist only
to save people from unknowingly writing code that breaks on MSVC.)
I'm not actually confident that MSVC isn't in violation of the standard
in this respect... (See e.g.
http://stackoverflow.com/questions/4866425/mixing-class-and-struct...)
--
Matthew
--
---
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/.
.
Author: Viacheslav Usov <via.usov@gmail.com>
Date: Wed, 11 Nov 2015 16:32:21 +0100
Raw View
--089e0111c4844887ed0524458888
Content-Type: text/plain; charset=UTF-8
On Wed, Nov 11, 2015 at 4:00 PM, Matthew Woehlke <mwoehlke.floss@gmail.com>
wrote:
> I'm not actually confident that MSVC isn't in violation of the standard
in this respect...
[dcl.type.elab].3: Thus, in any elaborated-type-specifier, the enum keyword
shall be used to refer to an enumeration (7.2), the union class-key shall
be used to refer to a union (Clause 9), and *either the class or struct
class-key* shall be used to refer to a class (Clause 9) declared using the
class or struct class-key. (end)
I would say that means it should not matter whether struct or class is used
in a friend/forward declaration, even though that could have been worded
more explicitly.
Cheers,
V.
--
---
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/.
--089e0111c4844887ed0524458888
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On W=
ed, Nov 11, 2015 at 4:00 PM, Matthew Woehlke <span dir=3D"ltr"><<a href=
=3D"mailto:mwoehlke.floss@gmail.com" target=3D"_blank">mwoehlke.floss@gmail=
..com</a>></span> wrote:<br><div><br></div><div>> I'm not actually=
confident that MSVC isn't in violation of the standard in this respect=
....</div><div><br></div><div>[dcl.type.elab].3: Thus, in any elaborated-typ=
e-specifier, the enum keyword shall be used to refer to
an enumeration (7.2), the union class-key shall be used to refer to a union=
(Clause 9), and <i>either the class
or struct class-key</i> shall be used to refer to a class (Clause 9) declar=
ed using the class or struct class-key. (end)<br></div><div><br></div><div>=
I would say that means it should not matter whether struct or class is used=
in a friend/forward declaration, even though that could have been worded m=
ore explicitly.</div><div><br></div><div>Cheers,</div><div>V.</div></div></=
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" 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 />
--089e0111c4844887ed0524458888--
.
Author: Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
Date: Wed, 11 Nov 2015 07:40:30 -0800 (PST)
Raw View
------=_Part_561_1424552097.1447256430752
Content-Type: multipart/alternative;
boundary="----=_Part_562_912634609.1447256430752"
------=_Part_562_912634609.1447256430752
Content-Type: text/plain; charset=UTF-8
>
> So no, there's really no reason for the user of `A` to care whether it's a
> `class` or a `struct`. Not in a metaprogramming context; you need to know
> if you're forward declaring it. But metaprogramming generally doesn't need
> to do that.
>
It's funny, how you simply state, that there is no reason for a user to
care whether or not a template param is a class or struct.
I could easily imagine a template, that handles data stemming from a struct
with POD semantic,
whereas it would switch to a more restricted mode in case the template
param containing the data is of type "class".
--
---
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_562_912634609.1447256430752
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><br><div>=
So no, there's really no reason for the user of `A` to care whether it&=
#39;s a `class` or a `struct`. Not in a metaprogramming context; you need t=
o know if you're forward declaring it. But metaprogramming generally do=
esn't need to do that.<br></div></blockquote><div><br>It's funny, h=
ow you simply state, that there is no reason for a user to care whether or =
not a template param is a class or struct.<br>I could easily imagine a temp=
late, that handles data stemming from a struct with POD semantic, <br>where=
as it would switch to a more restricted mode in case the=C2=A0 template par=
am containing the data is of type "class".<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" 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_562_912634609.1447256430752--
------=_Part_561_1424552097.1447256430752--
.
Author: Tony V E <tvaneerd@gmail.com>
Date: Wed, 11 Nov 2015 10:47:09 -0500
Raw View
--001a113fafd234bc4d052445bda6
Content-Type: text/plain; charset=UTF-8
On Wed, Nov 11, 2015 at 10:40 AM, Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
wrote:
>
>
>> So no, there's really no reason for the user of `A` to care whether it's
>> a `class` or a `struct`. Not in a metaprogramming context; you need to know
>> if you're forward declaring it. But metaprogramming generally doesn't need
>> to do that.
>>
>
> It's funny, how you simply state, that there is no reason for a user to
> care whether or not a template param is a class or struct.
> I could easily imagine a template, that handles data stemming from a
> struct with POD semantic,
> whereas it would switch to a more restricted mode in case the template
> param containing the data is of type "class".
>
>
I would suggest using std::is_pod<> instead of whether the object is a
class or struct.
Tony
--
---
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/.
--001a113fafd234bc4d052445bda6
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Wed, Nov 11, 2015 at 10:40 AM, Xxxx Yyyy <span dir=3D"ltr"><<a hr=
ef=3D"mailto:hermann.fuerntratt@joanneum.at" target=3D"_blank">hermann.fuer=
ntratt@joanneum.at</a>></span> wrote:<br><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">=
<div dir=3D"ltr"><span class=3D""><br><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1e=
x"><br><div>So no, there's really no reason for the user of `A` to care=
whether it's a `class` or a `struct`. Not in a metaprogramming context=
; you need to know if you're forward declaring it. But metaprogramming =
generally doesn't need to do that.<br></div></blockquote></span><div><b=
r>It's funny, how you simply state, that there is no reason for a user =
to care whether or not a template param is a class or struct.<br>I could ea=
sily imagine a template, that handles data stemming from a struct with POD =
semantic, <br>whereas it would switch to a more restricted mode in case the=
=C2=A0 template param containing the data is of type "class".<br>=
<br></div></div></blockquote><div><br></div><div>I would suggest using std:=
:is_pod<> instead of whether the object is a class or struct.<br><br>=
</div><div>Tony<br><br></div></div><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" 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 />
--001a113fafd234bc4d052445bda6--
.
Author: Nevin Liber <nevin@eviloverlord.com>
Date: Wed, 11 Nov 2015 09:46:59 -0600
Raw View
--001a1141e256f8a7ed052445bec6
Content-Type: text/plain; charset=UTF-8
On 11 November 2015 at 09:40, Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
wrote:
>
>> I could easily imagine a template, that handles data stemming from a
> struct with POD semantic,
> whereas it would switch to a more restricted mode in case the template
> param containing the data is of type "class".
>
Your imagination is different than what the standard says.
Traits are not a general reflection mechanism, and I haven't followed the
proposals in SG7 closely enough to see if they differentiate between struct
and class.
--
Nevin ":-)" Liber <mailto:nevin@eviloverlord.com> (847) 691-1404
--
---
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/.
--001a1141e256f8a7ed052445bec6
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">On 11 November 2015 at 09:40, Xxxx Yyyy <span dir=3D"ltr">=
<<a href=3D"mailto:hermann.fuerntratt@joanneum.at" target=3D"_blank">her=
mann.fuerntratt@joanneum.at</a>></span> wrote:<br><div class=3D"gmail_ex=
tra"><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 dir=3D"=
ltr"><span class=3D""><blockquote class=3D"gmail_quote" style=3D"margin:0;m=
argin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockqu=
ote></span><div>I could easily imagine a template, that handles data stemmi=
ng from a struct with POD semantic, <br>whereas it would switch to a more r=
estricted mode in case the=C2=A0 template param containing the data is of t=
ype "class".<br></div></div></blockquote><div><br></div><div>Your=
imagination is different than what the standard says.</div><div><br></div>=
<div>Traits are not a general reflection mechanism, and I haven't follo=
wed the proposals in SG7 closely enough to see if they differentiate betwee=
n struct and class.</div></div>-- <br><div class=3D"gmail_signature">=C2=A0=
Nevin ":-)" Liber=C2=A0 <mailto:<a href=3D"mailto:nevin@evilov=
erlord.com" target=3D"_blank">nevin@eviloverlord.com</a>>=C2=A0 (847) 69=
1-1404</div>
</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" 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 />
--001a1141e256f8a7ed052445bec6--
.
Author: Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
Date: Wed, 11 Nov 2015 07:58:34 -0800 (PST)
Raw View
------=_Part_7630_1560688755.1447257514323
Content-Type: multipart/alternative;
boundary="----=_Part_7631_1499241080.1447257514323"
------=_Part_7631_1499241080.1447257514323
Content-Type: text/plain; charset=UTF-8
>
> Your imagination is different than what the standard says.
>
Meanwhile I take this as a compliment, for I let my imagination fly, and
then someone comes and tells me, that this is a sin - according to the holy
bible.
--
---
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_7631_1499241080.1447257514323
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div><blockquote style=3D"margin: 0px 0px 0px 0.8ex; b=
order-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class=3D"gmai=
l_quote"><br><div>Your imagination is different than what the standard says=
..</div></blockquote><div><br>Meanwhile I take this as a compliment, for I l=
et my imagination fly, and then someone comes and tells me, that this is a =
sin - according to the holy bible. <br></div><div><br></div><br>=C2=A0</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" 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_7631_1499241080.1447257514323--
------=_Part_7630_1560688755.1447257514323--
.
Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Wed, 11 Nov 2015 11:06:49 -0500
Raw View
On 2015-11-11 10:40, Xxxx Yyyy wrote:
> It's funny, how you simply state, that there is no reason for a user to
> care whether or not a template param is a class or struct.
I really can't think of one.
> I could easily imagine a template, that handles data stemming from a
> struct with POD semantic,whereas it would switch to a more restricted
> mode in case the template param containing the data is of type
> "class".
You're mixing concepts. Specifically, you are thinking of traits like
standard layout, trivially copyable, etc. A "class" can have those just
as easily as a "struct". If you are trying to make that decision based
on "class" vs. "struct" rather than the *actual* relevant traits, then
you are doing it wrong and your code is broken. (Which is, in fact, an
EXCELLENT reason *NOT* to have a trait to tell the difference between
"class" and "struct", i.e. because it could be easily misused.)
--
Matthew
--
---
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/.
.
Author: Viacheslav Usov <via.usov@gmail.com>
Date: Wed, 11 Nov 2015 17:22:47 +0100
Raw View
--047d7b5d4a7ea54aee0524463c6f
Content-Type: text/plain; charset=UTF-8
On Wed, Nov 11, 2015 at 5:06 PM, Matthew Woehlke <mwoehlke.floss@gmail.com>
wrote:
> You're mixing concepts.
I know people who just refuse to accept that a class is a struct except
with an invisible private specifier slapped on it. Their reasoning is quite
sound: why would such a silly thing even need a special keyword? There
*must* be something more profound.
Cheers,
V.
--
---
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/.
--047d7b5d4a7ea54aee0524463c6f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On W=
ed, Nov 11, 2015 at 5:06 PM, Matthew Woehlke <span dir=3D"ltr"><<a href=
=3D"mailto:mwoehlke.floss@gmail.com" target=3D"_blank">mwoehlke.floss@gmail=
..com</a>></span> wrote:</div><div class=3D"gmail_quote"><br></div><div c=
lass=3D"gmail_quote">> You're mixing concepts.</div><div class=3D"gm=
ail_quote"><br></div><div class=3D"gmail_quote">I know people who just refu=
se to accept that a class is a struct except with an invisible private spec=
ifier slapped on it. Their reasoning is quite sound: why would such a silly=
thing even need a special keyword? There <i>must</i>=C2=A0be something mor=
e profound.</div><div class=3D"gmail_quote"><br></div><div class=3D"gmail_q=
uote">Cheers,</div><div class=3D"gmail_quote">V.</div></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" 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 />
--047d7b5d4a7ea54aee0524463c6f--
.
Author: Nicol Bolas <jmckesson@gmail.com>
Date: Wed, 11 Nov 2015 08:26:49 -0800 (PST)
Raw View
------=_Part_2708_964814869.1447259209352
Content-Type: multipart/alternative;
boundary="----=_Part_2709_1566799287.1447259209353"
------=_Part_2709_1566799287.1447259209353
Content-Type: text/plain; charset=UTF-8
On Wednesday, November 11, 2015 at 10:40:31 AM UTC-5, Xxxx Yyyy wrote:
>
>
>
>> So no, there's really no reason for the user of `A` to care whether it's
>> a `class` or a `struct`. Not in a metaprogramming context; you need to know
>> if you're forward declaring it. But metaprogramming generally doesn't need
>> to do that.
>>
>
> It's funny, how you simply state, that there is no reason for a user to
> care whether or not a template param is a class or struct.
> I could easily imagine a template, that handles data stemming from a
> struct with POD semantic,
> whereas it would switch to a more restricted mode in case the template
> param containing the data is of type "class".
>
A `class` can be POD too. Therefore, any code that "handles data stemming
from a struct with POD semantic" would use `is_pod` to check if the struct *or
class* type is POD. It would not rely merely on the fact that the type was
declared with `struct`.
--
---
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_2709_1566799287.1447259209353
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
On Wednesday, November 11, 2015 at 10:40:31 AM UTC-5, Xxxx Yyyy wrote:<bloc=
kquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-l=
eft: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><br><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #cc=
c solid;padding-left:1ex"><br><div>So no, there's really no reason for =
the user of `A` to care whether it's a `class` or a `struct`. Not in a =
metaprogramming context; you need to know if you're forward declaring i=
t. But metaprogramming generally doesn't need to do that.<br></div></bl=
ockquote><div><br>It's funny, how you simply state, that there is no re=
ason for a user to care whether or not a template param is a class or struc=
t.<br>I could easily imagine a template, that handles data stemming from a =
struct with POD semantic, <br>whereas it would switch to a more restricted =
mode in case the=C2=A0 template param containing the data is of type "=
class".<br></div></div></blockquote><div><br>A `class` can be POD too.=
Therefore, any code that "handles data stemming from a struct with PO=
D semantic" would use `is_pod` to check if the struct <i>or class</i> =
type is POD. It would not rely merely on the fact that the type was declare=
d with `struct`.<br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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_2709_1566799287.1447259209353--
------=_Part_2708_964814869.1447259209352--
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Wed, 11 Nov 2015 09:05:20 -0800
Raw View
On Wednesday 11 November 2015 00:13:24 Xxxx Yyyy wrote:
> > Try this:
> > enum class E : signed char { a = -1 };
> > E e = E::a;
> >
> > ++e;
> > e + 1;
> > e * 2;
>
> Why on earth, would you try to do such things with enums??
You tell me. You're the one who asked for it to behave the same as arithmetic
integrals in one particular case (std::is_signed). If it's going to behave the
same there, why not in other cases?
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--
---
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/.
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Wed, 11 Nov 2015 09:09:05 -0800
Raw View
On Wednesday 11 November 2015 10:00:54 Matthew Woehlke wrote:
> I'm not actually confident that MSVC isn't in violation of the standard
> in this respect... (See e.g.
> http://stackoverflow.com/questions/4866425/mixing-class-and-struct...)
Last time this discussion came up, we concluded that yes, MSVC behaviour is in
violation of the standard.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--
---
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/.
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Wed, 11 Nov 2015 09:11:47 -0800
Raw View
On Wednesday 11 November 2015 17:22:47 Viacheslav Usov wrote:
> On Wed, Nov 11, 2015 at 5:06 PM, Matthew Woehlke <mwoehlke.floss@gmail.com>
>
> wrote:
> > You're mixing concepts.
>
> I know people who just refuse to accept that a class is a struct except
> with an invisible private specifier slapped on it. Their reasoning is quite
> sound: why would such a silly thing even need a special keyword? There
> *must* be something more profound.
I've wondered the same and I think we even discussed this the last time the
topic came up. If there was a difference in Bjarne's mind when C with Classes
was first written, it's lost to history.
One speculation from that thread that is just as valid as any other theory was
that "C with Classes" needed to have classes, so the keyword was added.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--
---
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/.
.
Author: Xxxx Yyyy <hermann.fuerntratt@joanneum.at>
Date: Wed, 11 Nov 2015 09:12:10 -0800 (PST)
Raw View
------=_Part_689_57108596.1447261930719
Content-Type: multipart/alternative;
boundary="----=_Part_690_1807395029.1447261930727"
------=_Part_690_1807395029.1447261930727
Content-Type: text/plain; charset=UTF-8
You tell me. You're the one who asked for it to behave the same as
arithmetic
> integrals in one particular case (std::is_signed). If it's going to behave
> the
> same there, why not in other cases?
>
>
> Because as you have stated, calculus with enums does not really make sense
(an enum is not an algebraic corpus).
Propagating the is_signed trait does make sense
--
---
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_690_1807395029.1447261930727
Content-Type: text/html; charset=UTF-8
<div dir="ltr">You tell me. You're the one who asked for it to behave the same as arithmetic
<br><blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">integrals in one particular case (std::is_signed). If it's going to behave the
<br>same there, why not in other cases?
<br>
<br><br></blockquote><div>Because as you have stated, calculus with enums does not really make sense (an enum is not an algebraic corpus).<br>Propagating the is_signed trait does make sense<br></div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />
------=_Part_690_1807395029.1447261930727--
------=_Part_689_57108596.1447261930719--
.
Author: =?UTF-8?Q?Agust=c3=adn_K-ballo_Berg=c3=a9?= <kaballo86@hotmail.com>
Date: Wed, 11 Nov 2015 14:16:48 -0300
Raw View
On 11/11/2015 11:11 AM, Xxxx Yyyy wrote:
>
>
> No, the behavior you want is not "totally correct according to the
> standard". You keep missing the important point here: an enumeration
> is /not its underlying type/. Just as a struct is not a data member.
> `struct foo { int bar;}` is neither signed nor unsigned. Just as
> `enum foo : int {};` is neither signed nor unsigned.
>
>
> I just wonder, why no one here is talking about
> std::is_class<>
> as it returns true for structs as well, although a struct is definitely
> not a class.
> Ever thought about this?
A class type is a class defined with any of the class-keys `class`,=20
`struct`, or `union`. More specifically:
- class type: class T; struct T; union T;
- struct type: class T; struct T; (non-union class)
- union type: union T;
So when you say that a struct is definitively not a class, you are=20
definitively wrong.
The definition of `std::is_class` says it yields whether `T` is a=20
**class type** but not a **union type**. You should be asking why=20
doesn't `std::is_class` return true for a union type, since according to=20
what the trait does it should have been called `std::is_struct` instead.
I don't know the answer to such question myself.
Regards,
--=20
Agust=C3=ADn K-ballo Berg=C3=A9.-
http://talesofcpp.fusionfenix.com
--=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: Thiago Macieira <thiago@macieira.org>
Date: Wed, 11 Nov 2015 09:18:38 -0800
Raw View
On Wednesday 11 November 2015 09:05:20 Thiago Macieira wrote:
> On Wednesday 11 November 2015 00:13:24 Xxxx Yyyy wrote:
> > > Try this:
> > > enum class E : signed char { a = -1 };
> > > E e = E::a;
> > >
> > > ++e;
> > > e + 1;
> > > e * 2;
> >
> > Why on earth, would you try to do such things with enums??
>
> You tell me. You're the one who asked for it to behave the same as
> arithmetic integrals in one particular case (std::is_signed). If it's going
> to behave the same there, why not in other cases?
Actually, let's make this concrete. There's a reason I asked for arithmetic
operations: because that's what you'd be expected to do after you conclude
that a given type is signed.
For example, let's take code like this:
template <typename T> void do_op(T t)
{
if (std::is_signed<T>::value)
do_signed_op(t);
else
do_unsigned_op(t);
}
The implicit assumption here is that std::is_signed is complementary to
std::is_unsigned (read: when one is true, the other is false). We know that it
isn't true: there are types that are neither signed nor unsigned. So either
the code above is bad or it passes on that assumption to its users.
The question then is what is in do_signed_op? That's the same question that
Nicol asked you.
We're looking for an example for what would be there that would be valid for
enums.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--
---
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/.
.
Author: Viacheslav Usov <via.usov@gmail.com>
Date: Wed, 11 Nov 2015 18:23:48 +0100
Raw View
--001a11c1e8d0dd9fb10524471651
Content-Type: text/plain; charset=UTF-8
On Wed, Nov 11, 2015 at 6:11 PM, Thiago Macieira <thiago@macieira.org>
wrote:
> I've wondered the same and I think we even discussed this the last time
the topic came up. If there was a difference in Bjarne's mind when C with
Classes was first written, it's lost to history.
Back in the 80's, I read *C: An Advanced Introduction *by Narain Gehani,
the first edition. I do not own one and cannot check, but I think I
remember there was a chapter on classes, with the keyword class used to
mean something that was really different from struct. I'd guess later it
was realized that there was no real need for a different keyword, but at
that point the keyword was very solidly part of the language.
Cheers,
V.
--
---
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/.
--001a11c1e8d0dd9fb10524471651
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">=
On Wed, Nov 11, 2015 at 6:11 PM, Thiago Macieira <span dir=3D"ltr"><<a h=
ref=3D"mailto:thiago@macieira.org" target=3D"_blank">thiago@macieira.org</a=
>></span> wrote:<br><div>=C2=A0</div><div>> I've wondered the sam=
e and I think we even discussed this the last time the topic came up. If th=
ere was a difference in Bjarne's mind when C with Classes was first wri=
tten, it's lost to history.</div><div><br></div><div>Back in the 80'=
;s, I read <i>C: An Advanced Introduction=C2=A0</i>by Narain Gehani, the fi=
rst edition. I do not own one and cannot check, but I think I remember ther=
e was a chapter on classes, with the keyword class used to mean something t=
hat was really different from struct. I'd guess later it was realized t=
hat there was no real need for a different keyword, but at that point the k=
eyword was very solidly part of the language.</div><div><br></div><div>Chee=
rs,</div><div>V.</div></div></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" 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 />
--001a11c1e8d0dd9fb10524471651--
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Wed, 11 Nov 2015 09:28:27 -0800
Raw View
On Wednesday 11 November 2015 18:23:48 Viacheslav Usov wrote:
> On Wed, Nov 11, 2015 at 6:11 PM, Thiago Macieira <thiago@macieira.org>
>
> wrote:
> > I've wondered the same and I think we even discussed this the last time
>
> the topic came up. If there was a difference in Bjarne's mind when C with
> Classes was first written, it's lost to history.
>
> Back in the 80's, I read *C: An Advanced Introduction *by Narain Gehani,
> the first edition. I do not own one and cannot check, but I think I
> remember there was a chapter on classes, with the keyword class used to
> mean something that was really different from struct. I'd guess later it
> was realized that there was no real need for a different keyword, but at
> that point the keyword was very solidly part of the language.
Indeed, the other theory was that classes allowed members, virtuals and/or
constructors/destructor, while structs didn't. Later, structs gained the same
ability, so the distinction was lost.
Unless someone asks Bjarne in an upcoming committee meeting, all theories more
or less the same probability of being true.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
--
---
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/.
.
Author: Matthew Woehlke <mwoehlke.floss@gmail.com>
Date: Wed, 11 Nov 2015 13:09:07 -0500
Raw View
On 2015-11-11 12:11, Thiago Macieira wrote:
> On Wednesday 11 November 2015 17:22:47 Viacheslav Usov wrote:
>> On Wed, Nov 11, 2015 at 5:06 PM, Matthew Woehlke wrote:
>>> You're mixing concepts.
>>
>> I know people who just refuse to accept that a class is a struct except
>> with an invisible private specifier slapped on it. Their reasoning is quite
>> sound: why would such a silly thing even need a special keyword? There
>> *must* be something more profound.
>
> I've wondered the same and I think we even discussed this the last time the
> topic came up. If there was a difference in Bjarne's mind when C with Classes
> was first written, it's lost to history.
>
> One speculation from that thread that is just as valid as any other theory was
> that "C with Classes" needed to have classes, so the keyword was added.
That sounds about right :-). Just like how we have 'template <typename
T>', even though it is *exactly* the same as 'template <class T>'...
just because 'typename' *sounds* better.
--
Matthew
--
---
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/.
.