Topic: Using a type alias name in the alias definition?


Author: itsjimporter@gmail.com
Date: Tue, 17 Jul 2018 13:22:34 -0700 (PDT)
Raw View
------=_Part_26284_385720724.1531858954613
Content-Type: multipart/alternative;
 boundary="----=_Part_26285_1102741222.1531858954613"

------=_Part_26285_1102741222.1531858954613
Content-Type: text/plain; charset="UTF-8"

(Note: This is just a quick sanity check before I try to write up something
a little more concrete.) Are there any reasons why it would be impossible
to modify the standard to allow using the name of a type alias in its
definition, similar to CRTP? For example:

  using my_type = foobar<my_type>;

I ask because this *appears* to be a relatively straightforward way to
handle at least common cases of recursive variants without magic like
Boost's `make_recursive_variant`. For example, you might define a JSON
container like this:

  using json = std::variant<
    double,
    std::string,
    std::vector<json>,
    std::map<std::string, json>
  >;

(The above would likely also require that `std::map` support values of
incomplete type like `std::vector` already does.) Currently, the only way
around this that I know of is to create one or more subclasses to
forward-declare some of the names as needed.

- 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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/762a20a9-6717-4bf7-b739-21344b173ea2%40isocpp.org.

------=_Part_26285_1102741222.1531858954613
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">(Note: This is just a quick sanity check before I try to w=
rite up something a little more concrete.) Are there any reasons why it wou=
ld be impossible to modify the standard to allow using the name of a type a=
lias in its definition, similar to CRTP? For example:<br><br><div style=3D"=
background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); bor=
der-style: solid; border-width: 1px; overflow-wrap: break-word;" class=3D"p=
rettyprint"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span=
 style=3D"color: #000;" class=3D"styled-by-prettify">=C2=A0 </span><span st=
yle=3D"color: #008;" class=3D"styled-by-prettify">using</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> my_type </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> foobar</span><span style=3D"color:=
 #080;" class=3D"styled-by-prettify">&lt;my_type&gt;</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">;</span></div></code></div><br>I =
ask because this *appears* to be a relatively straightforward way to handle=
 at least common cases of recursive variants without magic like Boost&#39;s=
 `make_recursive_variant`. For example, you might define a JSON container l=
ike this:<br><br><div style=3D"background-color: rgb(250, 250, 250); border=
-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflo=
w-wrap: break-word;" class=3D"prettyprint"><code class=3D"prettyprint"><div=
 class=3D"subprettyprint"><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">=C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-pret=
tify">using</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> json </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> std</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify">variant</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span st=
yle=3D"color: #008;" class=3D"styled-by-prettify">double</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 std</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">string</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 std</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify">vector</span><span style=3D"color: #080;" cl=
ass=3D"styled-by-prettify">&lt;json&gt;</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 std</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">map</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify">std</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">::</span><span style=3D"color: #008;" class=3D"styled-by-prettify">stri=
ng</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> json</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">&gt;;</span></div></code></=
div><br>(The above would likely also require that `std::map` support values=
 of incomplete type like `std::vector` already does.) Currently, the only w=
ay around this that I know of is to create one or more subclasses to forwar=
d-declare some of the names as needed.<br><br>- Jim<br><br><br><br>=C2=A0 <=
br></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/762a20a9-6717-4bf7-b739-21344b173ea2%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/762a20a9-6717-4bf7-b739-21344b173ea2=
%40isocpp.org</a>.<br />

------=_Part_26285_1102741222.1531858954613--

------=_Part_26284_385720724.1531858954613--

.


Author: Dawid Pilarski <picppstandard@gmail.com>
Date: Thu, 19 Jul 2018 15:15:32 +0200
Raw View
--0000000000005c113e057159f908
Content-Type: text/plain; charset="UTF-8"

What would that:   using my_type = foobar<my_type>;
mean to you?

If it would be possible, then for the compiler it's infinite recursion, so
it's not possible (as of my understanding).

2018-07-17 22:22 GMT+02:00 <itsjimporter@gmail.com>:

> (Note: This is just a quick sanity check before I try to write up
> something a little more concrete.) Are there any reasons why it would be
> impossible to modify the standard to allow using the name of a type alias
> in its definition, similar to CRTP? For example:
>
>   using my_type = foobar<my_type>;
>
> I ask because this *appears* to be a relatively straightforward way to
> handle at least common cases of recursive variants without magic like
> Boost's `make_recursive_variant`. For example, you might define a JSON
> container like this:
>
>   using json = std::variant<
>     double,
>     std::string,
>     std::vector<json>,
>     std::map<std::string, json>
>   >;
>
> (The above would likely also require that `std::map` support values of
> incomplete type like `std::vector` already does.) Currently, the only way
> around this that I know of is to create one or more subclasses to
> forward-declare some of the names as needed.
>
> - 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.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/762a20a9-6717-4bf7-
> b739-21344b173ea2%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/762a20a9-6717-4bf7-b739-21344b173ea2%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>

--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAJsLGmpMzb7L_Z1yc1gM7ovm2irgERjyWtjcqgjGVHjMBbmZSQ%40mail.gmail.com.

--0000000000005c113e057159f908
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">What would that:=C2=A0<span class=3D"gmail-m_-149010934746=
4383053styled-by-prettify" style=3D"font-family:monospace;font-size:10.4px;=
background-color:rgb(250,250,250);text-decoration-style:initial;text-decora=
tion-color:initial;color:rgb(0,0,0)">=C2=A0<span>=C2=A0</span></span><span =
class=3D"gmail-m_-1490109347464383053styled-by-prettify" style=3D"font-fami=
ly:monospace;font-size:10.4px;background-color:rgb(250,250,250);text-decora=
tion-style:initial;text-decoration-color:initial;color:rgb(0,0,136)">using<=
/span><span class=3D"gmail-m_-1490109347464383053styled-by-prettify" style=
=3D"font-family:monospace;font-size:10.4px;background-color:rgb(250,250,250=
);text-decoration-style:initial;text-decoration-color:initial;color:rgb(0,0=
,0)"><span>=C2=A0</span>my_type<span>=C2=A0</span></span><span class=3D"gma=
il-m_-1490109347464383053styled-by-prettify" style=3D"font-family:monospace=
;font-size:10.4px;background-color:rgb(250,250,250);text-decoration-style:i=
nitial;text-decoration-color:initial;color:rgb(102,102,0)">=3D</span><span =
class=3D"gmail-m_-1490109347464383053styled-by-prettify" style=3D"font-fami=
ly:monospace;font-size:10.4px;background-color:rgb(250,250,250);text-decora=
tion-style:initial;text-decoration-color:initial;color:rgb(0,0,0)"><span>=
=C2=A0</span>foobar</span><span class=3D"gmail-m_-1490109347464383053styled=
-by-prettify" style=3D"font-family:monospace;font-size:10.4px;background-co=
lor:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:in=
itial;color:rgb(0,136,0)">&lt;my_type&gt;</span><span class=3D"gmail-m_-149=
0109347464383053styled-by-prettify" style=3D"font-family:monospace;font-siz=
e:10.4px;background-color:rgb(250,250,250);text-decoration-style:initial;te=
xt-decoration-color:initial;color:rgb(102,102,0)">;=C2=A0<br></span>mean to=
 you?<br><br>If it would be possible, then for the compiler it&#39;s infini=
te recursion, so it&#39;s not possible (as of my understanding).<br></div><=
div class=3D"gmail_extra"><br><div class=3D"gmail_quote">2018-07-17 22:22 G=
MT+02:00  <span dir=3D"ltr">&lt;<a href=3D"mailto:itsjimporter@gmail.com" t=
arget=3D"_blank">itsjimporter@gmail.com</a>&gt;</span>:<br><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pad=
ding-left:1ex"><div dir=3D"ltr">(Note: This is just a quick sanity check be=
fore I try to write up something a little more concrete.) Are there any rea=
sons why it would be impossible to modify the standard to allow using the n=
ame of a type alias in its definition, similar to CRTP? For example:<br><br=
><div style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,1=
87);border-style:solid;border-width:1px" class=3D"m_-1490109347464383053pre=
ttyprint"><code class=3D"m_-1490109347464383053prettyprint"><div class=3D"m=
_-1490109347464383053subprettyprint"><span style=3D"color:#000" class=3D"m_=
-1490109347464383053styled-by-prettify">=C2=A0 </span><span style=3D"color:=
#008" class=3D"m_-1490109347464383053styled-by-prettify">using</span><span =
style=3D"color:#000" class=3D"m_-1490109347464383053styled-by-prettify"> my=
_type </span><span style=3D"color:#660" class=3D"m_-1490109347464383053styl=
ed-by-prettify">=3D</span><span style=3D"color:#000" class=3D"m_-1490109347=
464383053styled-by-prettify"> foobar</span><span style=3D"color:#080" class=
=3D"m_-1490109347464383053styled-by-prettify">&lt;my_type&gt;</span><span s=
tyle=3D"color:#660" class=3D"m_-1490109347464383053styled-by-prettify">;</s=
pan></div></code></div><br>I ask because this *appears* to be a relatively =
straightforward way to handle at least common cases of recursive variants w=
ithout magic like Boost&#39;s `make_recursive_variant`. For example, you mi=
ght define a JSON container like this:<br><br><div style=3D"background-colo=
r:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;border-=
width:1px" class=3D"m_-1490109347464383053prettyprint"><code class=3D"m_-14=
90109347464383053prettyprint"><div class=3D"m_-1490109347464383053subpretty=
print"><span style=3D"color:#000" class=3D"m_-1490109347464383053styled-by-=
prettify">=C2=A0 </span><span style=3D"color:#008" class=3D"m_-149010934746=
4383053styled-by-prettify">using</span><span style=3D"color:#000" class=3D"=
m_-1490109347464383053styled-by-prettify"> json </span><span style=3D"color=
:#660" class=3D"m_-1490109347464383053styled-by-prettify">=3D</span><span s=
tyle=3D"color:#000" class=3D"m_-1490109347464383053styled-by-prettify"> std=
</span><span style=3D"color:#660" class=3D"m_-1490109347464383053styled-by-=
prettify">::</span><span style=3D"color:#000" class=3D"m_-14901093474643830=
53styled-by-prettify">variant</span><span style=3D"color:#660" class=3D"m_-=
1490109347464383053styled-by-prettify">&lt;</span><span style=3D"color:#000=
" class=3D"m_-1490109347464383053styled-by-prettify"><br>=C2=A0 =C2=A0 </sp=
an><span style=3D"color:#008" class=3D"m_-1490109347464383053styled-by-pret=
tify">double</span><span style=3D"color:#660" class=3D"m_-14901093474643830=
53styled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-149010=
9347464383053styled-by-prettify"><br>=C2=A0 =C2=A0 std</span><span style=3D=
"color:#660" class=3D"m_-1490109347464383053styled-by-prettify">::</span><s=
pan style=3D"color:#008" class=3D"m_-1490109347464383053styled-by-prettify"=
>string</span><span style=3D"color:#660" class=3D"m_-1490109347464383053sty=
led-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-14901093474=
64383053styled-by-prettify"><br>=C2=A0 =C2=A0 std</span><span style=3D"colo=
r:#660" class=3D"m_-1490109347464383053styled-by-prettify">::</span><span s=
tyle=3D"color:#000" class=3D"m_-1490109347464383053styled-by-prettify">vect=
or</span><span style=3D"color:#080" class=3D"m_-1490109347464383053styled-b=
y-prettify">&lt;json&gt;</span><span style=3D"color:#660" class=3D"m_-14901=
09347464383053styled-by-prettify">,</span><span style=3D"color:#000" class=
=3D"m_-1490109347464383053styled-by-prettify"><br>=C2=A0 =C2=A0 std</span><=
span style=3D"color:#660" class=3D"m_-1490109347464383053styled-by-prettify=
">::</span><span style=3D"color:#000" class=3D"m_-1490109347464383053styled=
-by-prettify">map</span><span style=3D"color:#660" class=3D"m_-149010934746=
4383053styled-by-prettify">&lt;</span><span style=3D"color:#000" class=3D"m=
_-1490109347464383053styled-by-prettify">std</span><span style=3D"color:#66=
0" class=3D"m_-1490109347464383053styled-by-prettify">::</span><span style=
=3D"color:#008" class=3D"m_-1490109347464383053styled-by-prettify">string</=
span><span style=3D"color:#660" class=3D"m_-1490109347464383053styled-by-pr=
ettify">,</span><span style=3D"color:#000" class=3D"m_-1490109347464383053s=
tyled-by-prettify"> json</span><span style=3D"color:#660" class=3D"m_-14901=
09347464383053styled-by-prettify">&gt;</span><span style=3D"color:#000" cla=
ss=3D"m_-1490109347464383053styled-by-prettify"><br>=C2=A0 </span><span sty=
le=3D"color:#660" class=3D"m_-1490109347464383053styled-by-prettify">&gt;;<=
/span></div></code></div><br>(The above would likely also require that `std=
::map` support values of incomplete type like `std::vector` already does.) =
Currently, the only way around this that I know of is to create one or more=
 subclasses to forward-declare some of the names as needed.<br><br>- Jim<sp=
an class=3D"HOEnZb"><font color=3D"#888888"><br><br><br><br>=C2=A0 <br></fo=
nt></span></div><span class=3D"HOEnZb"><font color=3D"#888888">

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/762a20a9-6717-4bf7-b739-21344b173ea2%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/762a=
20a9-6717-4bf7-<wbr>b739-21344b173ea2%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><br></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAJsLGmpMzb7L_Z1yc1gM7ovm2irgERjyWtjc=
qgjGVHjMBbmZSQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAJsLGmpMzb7L_Z1y=
c1gM7ovm2irgERjyWtjcqgjGVHjMBbmZSQ%40mail.gmail.com</a>.<br />

--0000000000005c113e057159f908--

.


Author: itsjimporter@gmail.com
Date: Thu, 19 Jul 2018 11:50:07 -0700 (PDT)
Raw View
------=_Part_3983_1384000337.1532026207338
Content-Type: multipart/alternative;
 boundary="----=_Part_3984_26929602.1532026207338"

------=_Part_3984_26929602.1532026207338
Content-Type: text/plain; charset="UTF-8"

On Thursday, July 19, 2018 at 6:15:35 AM UTC-7, Dawid Pilarski wrote:
>
> What would that:   using my_type = foobar<my_type>;
> mean to you?
>
> If it would be possible, then for the compiler it's infinite recursion, so
> it's not possible (as of my understanding).
>

Well, consider the sanity check failed. :)

I started writing up an argument that perhaps `my_type` on the right should
be an invisible "proxy type" to break the recursion, but that adds spooky
complexity that I don't think I'd be comfortable with. However, if strong
typedefs existed, I could see something like the above being allowed. If a
strong typedef created a new type and were roughly equivalent to:

struct new_type : base {
  using base::base;
};

Then a strong typedef could use CRTP, making syntax like my suggestion
possible: `strong using my_type = foobar<my_type>` becomes:

struct my_type : foobar<my_type> {
  using foobar<my_type>::foobar;
};

Still, all that really saves is the `using` directive on the base type's
constructor, so I wouldn't consider this a significant motivation for
strong typedefs on its own.

- 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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/407515e5-f3e4-45e3-969e-733ce4c1f16a%40isocpp.org.

------=_Part_3984_26929602.1532026207338
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Thursday, July 19, 2018 at 6:15:35 AM UTC-7, Dawid Pila=
rski 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">Wh=
at would that:=C2=A0<span style=3D"font-family:monospace;font-size:10.4px;b=
ackground-color:rgb(250,250,250);color:rgb(0,0,0)">=C2=A0<span>=C2=A0</span=
></span><span style=3D"font-family:monospace;font-size:10.4px;background-co=
lor:rgb(250,250,250);color:rgb(0,0,136)">using</span><span style=3D"font-fa=
mily:monospace;font-size:10.4px;background-color:rgb(250,250,250);color:rgb=
(0,0,0)"><span>=C2=A0</span>my_type<span>=C2=A0</span></span><span style=3D=
"font-family:monospace;font-size:10.4px;background-color:rgb(250,250,250);c=
olor:rgb(102,102,0)">=3D</span><span style=3D"font-family:monospace;font-si=
ze:10.4px;background-color:rgb(250,250,250);color:rgb(0,0,0)"><span>=C2=A0<=
/span>foobar</span><span style=3D"font-family:monospace;font-size:10.4px;ba=
ckground-color:rgb(250,250,250);color:rgb(0,136,0)"><wbr>&lt;my_type&gt;</s=
pan><span style=3D"font-family:monospace;font-size:10.4px;background-color:=
rgb(250,250,250);color:rgb(102,102,0)">;=C2=A0<br></span>mean to you?<br><b=
r>If it would be possible, then for the compiler it&#39;s infinite recursio=
n, so it&#39;s not possible (as of my understanding).<br></div></blockquote=
><div><br></div><div>Well, consider the sanity check failed. :)</div><div><=
br></div><div>I started writing up an argument that perhaps `my_type` on th=
e right should be an invisible &quot;proxy type&quot; to break the recursio=
n, but that adds spooky complexity that I don&#39;t think I&#39;d be comfor=
table with. However, if strong typedefs existed, I could see something like=
 the above being allowed. If a strong typedef created a new type and were r=
oughly equivalent to:</div><div><br></div><div style=3D"background-color: r=
gb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; b=
order-width: 1px; overflow-wrap: break-word;" class=3D"prettyprint"><code c=
lass=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">struct</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> new_type </span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">:</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">base</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </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 <=
/span><span style=3D"color: #008;" class=3D"styled-by-prettify">using</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #008;" class=3D"styled-by-prettify">base</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: =
#008;" class=3D"styled-by-prettify">base</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><div><br></div><div>Then a stron=
g typedef could use CRTP, making syntax like my suggestion possible: `stron=
g using my_type =3D foobar&lt;my_type&gt;` becomes:</div><div><br></div><di=
v style=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 187=
, 187); border-style: solid; border-width: 1px; overflow-wrap: break-word;"=
 class=3D"prettyprint"><code class=3D"prettyprint"><div class=3D"subprettyp=
rint"><span style=3D"color: #008;" class=3D"styled-by-prettify">struct</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> my_type </span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> foobar</span><span style=
=3D"color: #080;" class=3D"styled-by-prettify">&lt;my_type&gt;</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">using</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> foobar</span><span style=3D"color: #080;" cl=
ass=3D"styled-by-prettify">&lt;my_type&gt;</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">foobar</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"styled-by-prett=
ify">};</span></div></code></div><div><br></div><div>Still, all that really=
 saves is the `using` directive on the base type&#39;s constructor, so I wo=
uldn&#39;t consider this a significant motivation for strong typedefs on it=
s own.<br></div><div><br></div><div>- Jim</div><br></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/407515e5-f3e4-45e3-969e-733ce4c1f16a%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/407515e5-f3e4-45e3-969e-733ce4c1f16a=
%40isocpp.org</a>.<br />

------=_Part_3984_26929602.1532026207338--

------=_Part_3983_1384000337.1532026207338--

.