Topic: 2 Type-Traits Proposals: Standard Transformations and


Author: Daryle Walker <darylew@gmail.com>
Date: Thu, 14 Nov 2013 03:52:01 -0800 (PST)
Raw View
------=_Part_218_9231271.1384429921188
Content-Type: text/plain; charset=ISO-8859-1

I uploaded two proposals the deal with adding more type-traits.

The first one deals with type-translations that are described in the
Standard<http://htmlpreview.github.io/?https://raw.github.com/CTMacUser/multiarray-iso-proposal/master/std-xform-proposal.html>.
There are several places in the Standard that map some type to another, but
there isn't a corresponding type-trait. Without said trait, you have to
read the Standard and create a type-trait class manually. Manual creation
isn't always easy for some of these, especially when implementation-defined
behavior is allowed.

An example is that all the built-in character types have to shadow another
integer type. The char16_t and char32_t types have their underlying type
spelled out. For char, you have two guesses. Finding the type wchar_tshadows isn't as slam-dunk trivial.

Another example is function argument passing. Not counting references, an
argument gets standard l-to-r-value, array-to-pointer, and
function-to-pointer conversions applied to it. Those are covered by
std::decay. Promotions may also be applied, but there is no type-trait for
that.

So far, I have two new transformation type-traits, a change to an existing
one (adding the built-in character types to std::underlying_type), plus a
test type-trait. If you know of other similar transformations in the
Standard, let me know so I can add them.

The second proposal does more array extent changing<http://htmlpreview.github.io/?https://raw.github.com/CTMacUser/multiarray-iso-proposal/master/array-traits-proposal.html>.
One type-traits removes a user-selectable number of extents from an array
type. (The current Standard has type-traits that do either one or all
extents.) The other type-trait adds extents to a given type.

Daryle W.

--

---
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_218_9231271.1384429921188
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I uploaded two proposals the deal with adding more type-tr=
aits.<br><br>The first one deals with <a href=3D"http://htmlpreview.github.=
io/?https://raw.github.com/CTMacUser/multiarray-iso-proposal/master/std-xfo=
rm-proposal.html">type-translations that are described in the Standard</a>.=
 There are several places in the Standard that map some type to another, bu=
t there isn't a corresponding type-trait. Without said trait, you have to r=
ead the Standard and create a type-trait class manually. Manual creation is=
n't always easy for some of these, especially when implementation-defined b=
ehavior is allowed.<br><br>An example is that all the built-in character ty=
pes have to shadow another integer type. The <span style=3D"font-family: co=
urier new,monospace;">char16_t </span>and <span style=3D"font-family: couri=
er new,monospace;">char32_t</span> types have their underlying type spelled=
 out. For <span style=3D"font-family: courier new,monospace;">char</span>, =
you have two guesses. Finding the type <span style=3D"font-family: courier =
new,monospace;">wchar_t</span> shadows isn't as slam-dunk trivial.<br><br>A=
nother example is function argument passing. Not counting references, an ar=
gument gets standard l-to-r-value, array-to-pointer, and function-to-pointe=
r conversions applied to it. Those are covered by <span style=3D"font-famil=
y: courier new,monospace;">std::decay</span>. Promotions may also be applie=
d, but there is no type-trait for that.<br><br>So far, I have two new trans=
formation type-traits, a change to an existing one (adding the built-in cha=
racter types to <span style=3D"font-family: courier new,monospace;">std::un=
derlying_type</span>), plus a test type-trait. If you know of other similar=
 transformations in the Standard, let me know so I can add them.<br><br>The=
 second proposal does <a href=3D"http://htmlpreview.github.io/?https://raw.=
github.com/CTMacUser/multiarray-iso-proposal/master/array-traits-proposal.h=
tml">more array extent changing</a>. One type-traits removes a user-selecta=
ble number of extents from an array type. (The current Standard has type-tr=
aits that do either one or all extents.) The other type-trait adds extents =
to a given type.<br><br>Daryle W.<br><br></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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_218_9231271.1384429921188--

.