Topic: Introduce "typegroups" for template


Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Thu, 27 Mar 2014 10:40:40 -0700
Raw View
--089e015365e6d0122004f59a1792
Content-Type: text/plain; charset=UTF-8

It seems that specializations aren't the right tool for what you want here.
Overloading already has this behavior: http://ideone.com/PHqhpZ


   1. #include <cstdio>
   2. #include <cstdint>
   3.
   4. template<typename T>
   5. void Print(T)
   6. {
   7.  std::printf("Nothing here!\n");
   8. }
   9.
   10. void Print(std::int64_t val)
   11. {
   12.  std::printf("%lld\n", val);
   13. }
   14.
   15. void Print(double val)
   16. {
   17.  std::printf("%f\n", val);
   18. }
   19.
   20. int main() {
   21.  Print(42ll);
   22.  Print(42.0);
   23.  Print("This is an unrelated type");
   24. }



Moreover, your printf example would be wrong; %i does not print long long
values.

Billy O'Neal
https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
http://stackoverflow.com/users/82320/billy-oneal


On Thu, Mar 27, 2014 at 10:11 AM, Peter Kondratyuk <pkondratyuk@gmail.com>wrote:

> Currently, when specializing templates for multiple types, each type has
> to have its own specialization. This requires code duplication when several
> of these specializations should behave identically.
>
> Obviously, duplicated code is bad, so I propose a new keyword,
> "typegroup", that is only used in template specializations. This keyword
> would tell the compiler to specialize the template identically for each
> type in the typegroup. The example below is a self-explanatory
> demonstration of the concept:
>
> Example:
>
> //Proposed introduction of the "typegroup" keyword into the C++ standard
> //To avoid code duplication in template specializations
>
> typegroup floatTypes {double, float, complex};
> typegroup intTypes {short, int, long long};
>
> //Templated function, but it also could be a method of a templated class
> template<typename T> void PrintValue(T value)
> {
>     //Do something for all types, except specialized one
>     printf("No specialization for this type.\n");
> }
>
> //Specialization of the function for all floatTypes
> template<> PrintValue<floatTypes>(floatTypes value)
> {
>     printf("%e \n", value);
> }
>
> //Specialization of the function for all intTypes
> template<> PrintValue<intTypes>(intTypes value)
> {
>     printf("%i \n", value);
> }
>
> --
>
> ---
> 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/.
>

--

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

--089e015365e6d0122004f59a1792
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">It seems that specializations aren&#39;t the right tool fo=
r what you want here. Overloading already has this behavior: <a href=3D"htt=
p://ideone.com/PHqhpZ">http://ideone.com/PHqhpZ</a><br><pre class=3D"" id=
=3D"source" style=3D"margin-bottom:0px">

<pre class=3D""><ol><li class=3D""><div class=3D""><span class=3D"">#includ=
e &lt;cstdio&gt;</span></div></li><li class=3D""><div class=3D""><span clas=
s=3D"">#include &lt;cstdint&gt;</span></div></li><li class=3D""><div class=
=3D"">=C2=A0</div></li>

<li class=3D""><div class=3D""><span class=3D"">template</span><span class=
=3D"">&lt;</span><span class=3D"">typename</span> T<span class=3D"">&gt;</s=
pan></div></li><li class=3D""><div class=3D""><span class=3D"">void</span> =
Print<span class=3D"">(</span>T<span class=3D"">)</span></div>

</li><li class=3D""><div class=3D""><span class=3D"">{</span></div></li><li=
 class=3D""><div class=3D""> std<span class=3D"">::</span><span class=3D"">=
printf</span><span class=3D"">(</span><span class=3D"">&quot;Nothing here!<=
span class=3D"">\n</span>&quot;</span><span class=3D"">)</span><span class=
=3D"">;</span></div>

</li><li class=3D""><div class=3D""><span class=3D"">}</span></div></li><li=
 class=3D""><div class=3D"">=C2=A0</div></li><li class=3D""><div class=3D""=
><span class=3D"">void</span> Print<span class=3D"">(</span>std<span class=
=3D"">::</span><span class=3D"">int64_t</span> val<span class=3D"">)</span>=
</div>

</li><li class=3D""><div class=3D""><span class=3D"">{</span></div></li><li=
 class=3D""><div class=3D""> std<span class=3D"">::</span><span class=3D"">=
printf</span><span class=3D"">(</span><span class=3D"">&quot;%lld<span clas=
s=3D"">\n</span>&quot;</span>, val<span class=3D"">)</span><span class=3D""=
>;</span></div>

</li><li class=3D""><div class=3D""><span class=3D"">}</span></div></li><li=
 class=3D""><div class=3D"">=C2=A0</div></li><li class=3D""><div class=3D""=
><span class=3D"">void</span> Print<span class=3D"">(</span><span class=3D"=
">double</span> val<span class=3D"">)</span></div>

</li><li class=3D""><div class=3D""><span class=3D"">{</span></div></li><li=
 class=3D""><div class=3D""> std<span class=3D"">::</span><span class=3D"">=
printf</span><span class=3D"">(</span><span class=3D"">&quot;%f<span class=
=3D"">\n</span>&quot;</span>, val<span class=3D"">)</span><span class=3D"">=
;</span></div>

</li><li class=3D""><div class=3D""><span class=3D"">}</span></div></li><li=
 class=3D""><div class=3D"">=C2=A0</div></li><li class=3D""><div class=3D""=
><span class=3D"">int</span> main<span class=3D"">(</span><span class=3D"">=
)</span> <span class=3D"">{</span></div>

</li><li class=3D""><div class=3D""> Print<span class=3D"">(</span>42ll<spa=
n class=3D"">)</span><span class=3D"">;</span></div></li><li class=3D""><di=
v class=3D""> Print<span class=3D"">(</span><span class=3D"">42.0</span><sp=
an class=3D"">)</span><span class=3D"">;</span></div>

</li><li class=3D""><div class=3D""> Print<span class=3D"">(</span><span cl=
ass=3D"">&quot;This is an unrelated type&quot;</span><span class=3D"">)</sp=
an><span class=3D"">;</span></div></li><li class=3D""><div class=3D""><span=
 class=3D"">}</span></div>

</li></ol></pre></pre><br><br>Moreover, your printf example would be wrong;=
 %i does not print long long values.<br></div><div class=3D"gmail_extra"><b=
r clear=3D"all"><div><div dir=3D"ltr"><div>Billy O&#39;Neal</div><div><a hr=
ef=3D"https://bitbucket.org/BillyONeal/" target=3D"_blank">https://github.c=
om/BillyONeal/</a></div>

<div><a href=3D"http://stackoverflow.com/users/82320/billy-oneal" target=3D=
"_blank">http://stackoverflow.com/users/82320/billy-oneal</a></div></div></=
div>
<br><br><div class=3D"gmail_quote">On Thu, Mar 27, 2014 at 10:11 AM, Peter =
Kondratyuk <span dir=3D"ltr">&lt;<a href=3D"mailto:pkondratyuk@gmail.com" t=
arget=3D"_blank">pkondratyuk@gmail.com</a>&gt;</span> wrote:<br><blockquote=
 class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli=
d;padding-left:1ex">

<div dir=3D"ltr">Currently, when specializing templates for multiple types,=
 each type has to have its own specialization. This requires code duplicati=
on when several of these specializations should behave identically.<br><br>

Obviously, duplicated code is bad, so I propose a new keyword, &quot;typegr=
oup&quot;, that is only used in template specializations. This keyword woul=
d tell the compiler to specialize the template identically for each type in=
 the typegroup. The example below is a self-explanatory demonstration of th=
e concept:<br>

<br>Example:<br><br>//Proposed introduction of the &quot;typegroup&quot; ke=
yword into the C++ standard<br>//To avoid code duplication in template spec=
ializations<br><br>typegroup floatTypes {double, float, complex};<br>typegr=
oup intTypes {short, int, long long};<br>

<br>//Templated function, but it also could be a method of a templated clas=
s<br>template&lt;typename T&gt; void PrintValue(T value)<br>{<br>=C2=A0=C2=
=A0=C2=A0 //Do something for all types, except specialized one<br>=C2=A0=C2=
=A0=C2=A0 printf(&quot;No specialization for this type.\n&quot;);<br>

}<br><br>//Specialization of the function for all floatTypes<br>template&lt=
;&gt; PrintValue&lt;floatTypes&gt;(floatTypes value)<br>{<br>=C2=A0=C2=A0=
=C2=A0 printf(&quot;%e \n&quot;, value);<br>}<br><br>//Specialization of th=
e function for all intTypes<br>

template&lt;&gt; PrintValue&lt;intTypes&gt;(intTypes value)<br>{<br>=C2=A0=
=C2=A0=C2=A0 printf(&quot;%i \n&quot;, value);<br>}<span class=3D"HOEnZb"><=
font color=3D"#888888"><br></font></span></div><span class=3D"HOEnZb"><font=
 color=3D"#888888">

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</font></span></blockquote></div><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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--089e015365e6d0122004f59a1792--

.


Author: Zhihao Yuan <zy@miator.net>
Date: Thu, 27 Mar 2014 13:58:55 -0400
Raw View
On Thu, Mar 27, 2014 at 1:11 PM, Peter Kondratyuk <pkondratyuk@gmail.com> wrote:
> typegroup floatTypes {double, float, complex};
> typegroup intTypes {short, int, long long};
>
> //Templated function, but it also could be a method of a templated class
> template<typename T> void PrintValue(T value)
> {
>     //Do something for all types, except specialized one
>     printf("No specialization for this type.\n");
> }
>
> //Specialization of the function for all floatTypes
> template<> PrintValue<floatTypes>(floatTypes value)
> {
>     printf("%e \n", value);
> }
>
> //Specialization of the function for all intTypes
> template<> PrintValue<intTypes>(intTypes value)
> {
>     printf("%i \n", value);
> }

Function templates can be overloaded, so you already able to

template <typename T>
auto Print(T) -> std::enable_if_t<std::is_integral<T>{}>
{
    std::cout << "integer" << std::endl;
}

template <typename T>
auto Print(T) -> std::enable_if_t<std::is_floating_point<T>{}>
{
    std::cout << "floating point" << std::endl;
}

int main()
{
    Print(0);
    Print(0.0);
}

If you want to write you own "typegroup" traits, some
meta functions sounds like "is_one_of" might help, and
such a construct can be build with the help of a typelist
or a language supported one in the future:

  http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3728.html

And if you don't like the `enable_if` syntax (no one does),
concepts lite in the future can turn a type predicate into
a concept, so that you can write

  template <Integral T>
  void Print(T v);

The old "terse" syntax of concepts lite allows you to write the
above as:

  void Print(Integral v);

But it has its own problem.  We expect to see a new one.

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/

--

---
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: Peter Kondratyuk <pkondratyuk@gmail.com>
Date: Thu, 27 Mar 2014 10:59:26 -0700 (PDT)
Raw View
------=_Part_595_26127022.1395943166355
Content-Type: text/plain; charset=UTF-8

Overloading suffers from exactly the same problem - you would need to
overload the function for each type (double, float for one specialization,
and int, short and long for the other) and the code would be duplicated.
The printf() in the example is not a great choice, obviously; it just
serves to illustrate the purpose, which is to avoid duplication for types
that should behave identically in the simulation.

So i believe the point of the proposal is still correct. Do you disagree?
Peter


On Thursday, March 27, 2014 7:11:37 PM UTC+2, Peter Kondratyuk wrote:
>
> Currently, when specializing templates for multiple types, each type has
> to have its own specialization. This requires code duplication when several
> of these specializations should behave identically.
>
> Obviously, duplicated code is bad, so I propose a new keyword,
> "typegroup", that is only used in template specializations. This keyword
> would tell the compiler to specialize the template identically for each
> type in the typegroup. The example below is a self-explanatory
> demonstration of the concept:
>
> Example:
>
> //Proposed introduction of the "typegroup" keyword into the C++ standard
> //To avoid code duplication in template specializations
>
> typegroup floatTypes {double, float, complex};
> typegroup intTypes {short, int, long long};
>
> //Templated function, but it also could be a method of a templated class
> template<typename T> void PrintValue(T value)
> {
>     //Do something for all types, except specialized one
>     printf("No specialization for this type.\n");
> }
>
> //Specialization of the function for all floatTypes
> template<> PrintValue<floatTypes>(floatTypes value)
> {
>     printf("%e \n", value);
> }
>
> //Specialization of the function for all intTypes
> template<> PrintValue<intTypes>(intTypes value)
> {
>     printf("%i \n", value);
> }
>

--

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

<div dir=3D"ltr">Overloading suffers from exactly the same problem - you wo=
uld need to overload the function for each type (double, float for one spec=
ialization, and int, short and long for the other) and the code would be du=
plicated. The printf() in the example is not a great choice, obviously; it =
just serves to illustrate the purpose, which is to avoid duplication for ty=
pes that should behave identically in the simulation.<br><br>So i believe t=
he point of the proposal is still correct. Do you disagree?<br>Peter<br><br=
><br>On Thursday, March 27, 2014 7:11:37 PM UTC+2, Peter Kondratyuk wrote:<=
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">Currently, whe=
n specializing templates for multiple types, each type has to have its own =
specialization. This requires code duplication when several of these specia=
lizations should behave identically.<br><br>Obviously, duplicated code is b=
ad, so I propose a new keyword, "typegroup", that is only used in template =
specializations. This keyword would tell the compiler to specialize the tem=
plate identically for each type in the typegroup. The example below is a se=
lf-explanatory demonstration of the concept:<br><br>Example:<br><br>//Propo=
sed introduction of the "typegroup" keyword into the C++ standard<br>//To a=
void code duplication in template specializations<br><br>typegroup floatTyp=
es {double, float, complex};<br>typegroup intTypes {short, int, long long};=
<br><br>//Templated function, but it also could be a method of a templated =
class<br>template&lt;typename T&gt; void PrintValue(T value)<br>{<br>&nbsp;=
&nbsp;&nbsp; //Do something for all types, except specialized one<br>&nbsp;=
&nbsp;&nbsp; printf("No specialization for this type.\n");<br>}<br><br>//Sp=
ecialization of the function for all floatTypes<br>template&lt;&gt; PrintVa=
lue&lt;floatTypes&gt;(<wbr>floatTypes value)<br>{<br>&nbsp;&nbsp;&nbsp; pri=
ntf("%e \n", value);<br>}<br><br>//Specialization of the function for all i=
ntTypes<br>template&lt;&gt; PrintValue&lt;intTypes&gt;(intTypes value)<br>{=
<br>&nbsp;&nbsp;&nbsp; printf("%i \n", value);<br>}<br></div></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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_595_26127022.1395943166355--

.


Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Thu, 27 Mar 2014 11:05:41 -0700
Raw View
--089e0149c380568e3604f59a7142
Content-Type: text/plain; charset=UTF-8

No, overloading doesn't suffer that problem. Look at my example again -- I
passed int, plain int, and it called the long long overload even though
there was a function template of the same name accepting any T.

We can't argue that the proposal makes sense without a concrete problem it
solves not already solved by other language features.

Billy O'Neal
https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
http://stackoverflow.com/users/82320/billy-oneal


On Thu, Mar 27, 2014 at 10:59 AM, Peter Kondratyuk <pkondratyuk@gmail.com>wrote:

> Overloading suffers from exactly the same problem - you would need to
> overload the function for each type (double, float for one specialization,
> and int, short and long for the other) and the code would be duplicated.
> The printf() in the example is not a great choice, obviously; it just
> serves to illustrate the purpose, which is to avoid duplication for types
> that should behave identically in the simulation.
>
> So i believe the point of the proposal is still correct. Do you disagree?
> Peter
>
>
>
> On Thursday, March 27, 2014 7:11:37 PM UTC+2, Peter Kondratyuk wrote:
>>
>> Currently, when specializing templates for multiple types, each type has
>> to have its own specialization. This requires code duplication when several
>> of these specializations should behave identically.
>>
>> Obviously, duplicated code is bad, so I propose a new keyword,
>> "typegroup", that is only used in template specializations. This keyword
>> would tell the compiler to specialize the template identically for each
>> type in the typegroup. The example below is a self-explanatory
>> demonstration of the concept:
>>
>> Example:
>>
>> //Proposed introduction of the "typegroup" keyword into the C++ standard
>> //To avoid code duplication in template specializations
>>
>> typegroup floatTypes {double, float, complex};
>> typegroup intTypes {short, int, long long};
>>
>> //Templated function, but it also could be a method of a templated class
>> template<typename T> void PrintValue(T value)
>> {
>>     //Do something for all types, except specialized one
>>     printf("No specialization for this type.\n");
>> }
>>
>> //Specialization of the function for all floatTypes
>> template<> PrintValue<floatTypes>(floatTypes value)
>> {
>>     printf("%e \n", value);
>> }
>>
>> //Specialization of the function for all intTypes
>> template<> PrintValue<intTypes>(intTypes value)
>> {
>>     printf("%i \n", value);
>> }
>>
>  --
>
> ---
> 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/.
>

--

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

--089e0149c380568e3604f59a7142
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>No, overloading doesn&#39;t suffer that problem. Look=
 at my example again -- I passed int, plain int, and it called the long lon=
g overload even though there was a function template of the same name accep=
ting any T.<br>

<br></div>We can&#39;t argue that the proposal makes sense without a concre=
te problem it solves not already solved by other language features.<br></di=
v><div class=3D"gmail_extra"><br clear=3D"all"><div><div dir=3D"ltr"><div>B=
illy O&#39;Neal</div>

<div><a href=3D"https://bitbucket.org/BillyONeal/" target=3D"_blank">https:=
//github.com/BillyONeal/</a></div><div><a href=3D"http://stackoverflow.com/=
users/82320/billy-oneal" target=3D"_blank">http://stackoverflow.com/users/8=
2320/billy-oneal</a></div>

</div></div>
<br><br><div class=3D"gmail_quote">On Thu, Mar 27, 2014 at 10:59 AM, Peter =
Kondratyuk <span dir=3D"ltr">&lt;<a href=3D"mailto:pkondratyuk@gmail.com" t=
arget=3D"_blank">pkondratyuk@gmail.com</a>&gt;</span> wrote:<br><blockquote=
 class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli=
d;padding-left:1ex">

<div dir=3D"ltr">Overloading suffers from exactly the same problem - you wo=
uld need to overload the function for each type (double, float for one spec=
ialization, and int, short and long for the other) and the code would be du=
plicated. The printf() in the example is not a great choice, obviously; it =
just serves to illustrate the purpose, which is to avoid duplication for ty=
pes that should behave identically in the simulation.<br>

<br>So i believe the point of the proposal is still correct. Do you disagre=
e?<span class=3D"HOEnZb"><font color=3D"#888888"><br>Peter</font></span><di=
v><div class=3D"h5"><br><br><br>On Thursday, March 27, 2014 7:11:37 PM UTC+=
2, Peter Kondratyuk 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">Currently, when specializing templates for multiple types,=
 each type has to have its own specialization. This requires code duplicati=
on when several of these specializations should behave identically.<br><br>

Obviously, duplicated code is bad, so I propose a new keyword, &quot;typegr=
oup&quot;, that is only used in template specializations. This keyword woul=
d tell the compiler to specialize the template identically for each type in=
 the typegroup. The example below is a self-explanatory demonstration of th=
e concept:<br>

<br>Example:<br><br>//Proposed introduction of the &quot;typegroup&quot; ke=
yword into the C++ standard<br>//To avoid code duplication in template spec=
ializations<br><br>typegroup floatTypes {double, float, complex};<br>typegr=
oup intTypes {short, int, long long};<br>

<br>//Templated function, but it also could be a method of a templated clas=
s<br>template&lt;typename T&gt; void PrintValue(T value)<br>{<br>=C2=A0=C2=
=A0=C2=A0 //Do something for all types, except specialized one<br>=C2=A0=C2=
=A0=C2=A0 printf(&quot;No specialization for this type.\n&quot;);<br>

}<br><br>//Specialization of the function for all floatTypes<br>template&lt=
;&gt; PrintValue&lt;floatTypes&gt;(<u></u>floatTypes value)<br>{<br>=C2=A0=
=C2=A0=C2=A0 printf(&quot;%e \n&quot;, value);<br>}<br><br>//Specialization=
 of the function for all intTypes<br>

template&lt;&gt; PrintValue&lt;intTypes&gt;(intTypes value)<br>{<br>=C2=A0=
=C2=A0=C2=A0 printf(&quot;%i \n&quot;, value);<br>}<br></div></blockquote><=
/div></div></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--089e0149c380568e3604f59a7142--

.


Author: Peter Kondratyuk <pkondratyuk@gmail.com>
Date: Thu, 27 Mar 2014 11:11:28 -0700 (PDT)
Raw View
------=_Part_706_22150600.1395943888470
Content-Type: text/plain; charset=UTF-8

@ Zhihao

Yes, I believe that enable_if solves the same problem, but is far more
complex syntactically and conceptually than a typegroup. And there's a need
to use "enable_if" in combination with "is_one_of", since type tests in the
std library won't cover every combination of types. So it seems to me that
this problem can be solved much more elegantly with a keyword addition.

--

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

<div dir=3D"ltr">@ Zhihao<br><br>Yes, I believe that enable_if solves the s=
ame problem, but is far more complex syntactically and conceptually than a =
typegroup. And there's a need to use "enable_if" in combination with "is_on=
e_of", since type tests in the std library won't cover every combination of=
 types. So it seems to me that this problem can be solved much more elegant=
ly with a keyword addition.<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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_706_22150600.1395943888470--

.


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Thu, 27 Mar 2014 13:14:44 -0500
Raw View
--047d7bdc9e02af4e7804f59a918b
Content-Type: text/plain; charset=ISO-8859-1

On 27 March 2014 13:11, Peter Kondratyuk <pkondratyuk@gmail.com> wrote:

> Yes, I believe that enable_if solves the same problem, but is far more
> complex syntactically and conceptually than a typegroup. And there's a need
> to use "enable_if" in combination with "is_one_of", since type tests in the
> std library won't cover every combination of types. So it seems to me that
> this problem can be solved much more elegantly with a keyword addition.
>

Is that still true once we have Concepts Lite?
--
 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/.

--047d7bdc9e02af4e7804f59a918b
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On 27 March 2014 13:11, Peter Kondratyuk <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:pkondratyuk@gmail.com" target=3D"_blank">pkondratyuk=
@gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=
=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Yes, I believe that enable_=
if solves the same problem, but is far more complex syntactically and conce=
ptually than a typegroup. And there&#39;s a need to use &quot;enable_if&quo=
t; in combination with &quot;is_one_of&quot;, since type tests in the std l=
ibrary won&#39;t cover every combination of types. So it seems to me that t=
his problem can be solved much more elegantly with a keyword addition.<br>

</div></blockquote><div><br></div><div>Is that still true once we have Conc=
epts Lite?</div></div>-- <br>=A0Nevin &quot;:-)&quot; Liber=A0 &lt;mailto:<=
a href=3D"mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlo=
rd.com</a>&gt;=A0 (847) 691-1404
</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--047d7bdc9e02af4e7804f59a918b--

.


Author: Zhihao Yuan <zy@miator.net>
Date: Thu, 27 Mar 2014 14:22:16 -0400
Raw View
On Thu, Mar 27, 2014 at 2:11 PM, Peter Kondratyuk <pkondratyuk@gmail.com> wrote:
> @ Zhihao
>
> Yes, I believe that enable_if solves the same problem, but is far more
> complex syntactically and conceptually than a typegroup. And there's a need
> to use "enable_if" in combination with "is_one_of", since type tests in the
> std library won't cover every combination of types. So it seems to me that
> this problem can be solved much more elegantly with a keyword addition.

I listed two proposals in my reply.  With them, the whole solution
is supposed to look like:

template <typename T>
constexpr bool Float = is_one_of_v<T, <double, float, complex>>;
// is_one_of is just a simple variadic meta function
// <T...> is the proposed typelist syntax
// the whole thing is a "concept" as variable template

void Print(Float{T} v) {}  // tentative new terse syntax

The program structure above looks simple enough to me.

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/

--

---
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: Peter Kondratyuk <pkondratyuk@gmail.com>
Date: Thu, 27 Mar 2014 11:30:12 -0700 (PDT)
Raw View
------=_Part_589_8155831.1395945013087
Content-Type: text/plain; charset=UTF-8

@ Billy

The problem with overloads is still there! In your example it's just hidden
by the ability of the compiler to upconvert int to __int64. But what if I
can't have the argument be converted to the longest type, and actually need
the specialization for each of those types that have to behave identically?
For example, what if I am looking for the sizeof() of the argument passed
to the function?

Respectfully, I don't think you understand the essence of the problem, so
I'll rephrase it. Without code duplication, it's currently not possible to
create specializations to behave identically for several of types (not
necessarily related types). Say I need one specialization for types {int,
std::string} and another specialization for types {double, complex,
myType}. I saw the mention of "enable_if" and "is_one_of" metafunctions,
but the syntax is pretty bad, and it generally seems like an
overcomplicated solution (imho).

Peter

--

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

<div dir=3D"ltr">@ Billy<br><br>The problem with overloads is still there! =
In your example it's just hidden by the ability of the compiler to upconver=
t int to __int64. But what if I can't have the argument be converted to the=
 longest type, and actually need the specialization for each of those types=
 that have to behave identically? For example, what if I am looking for the=
 sizeof() of the argument passed to the function?<br><br>Respectfully, I do=
n't think you understand the essence of the problem, so I'll rephrase it. W=
ithout code duplication, it's currently not possible to create specializati=
ons to behave identically for several of types (not necessarily related typ=
es). Say I need one specialization for types {int, std::string} and another=
 specialization for types {double, complex, myType}. I saw the mention of "=
enable_if" and "is_one_of" metafunctions, but the syntax is pretty bad, and=
 it generally seems like an overcomplicated solution (imho).<br><br>Peter<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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_589_8155831.1395945013087--

.


Author: Peter Kondratyuk <pkondratyuk@gmail.com>
Date: Thu, 27 Mar 2014 11:45:29 -0700 (PDT)
Raw View
------=_Part_31_20129796.1395945929075
Content-Type: text/plain; charset=UTF-8

@ Zhihao

Thanks, I didn't know about this proposed new syntax... This looks like
it's usable, but still feels like an overkill subjectively to me. Do you
know when they plan to introduce it?

template <typename T>
constexpr bool Float = is_one_of_v<T, <double, float, complex>>;

void Print(Float{T} v) {}  // tentative new terse syntax

--

---
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_31_20129796.1395945929075
Content-Type: text/html; charset=UTF-8

<div dir="ltr">@ Zhihao<br><br>Thanks, I didn't know about this proposed new syntax... This looks like it's usable, but still feels like an overkill subjectively to me. Do you know when they plan to introduce it?<br><br>template &lt;typename T&gt;
<br>constexpr bool Float = is_one_of_v&lt;T, &lt;double, float, complex&gt;&gt;;&nbsp;
<br>
<br>void Print(Float{T} v) {} &nbsp;// tentative new terse syntax<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&quot; 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_31_20129796.1395945929075--

.


Author: Tony V E <tvaneerd@gmail.com>
Date: Thu, 27 Mar 2014 14:45:49 -0400
Raw View
--001a11c2a0f476f78704f59afeb3
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Mar 27, 2014 at 1:58 PM, Zhihao Yuan <zy@miator.net> wrote:

>
>
> Function templates can be overloaded, so you already able to
>
> template <typename T>
> auto Print(T) -> std::enable_if_t<std::is_integral<T>{}>
> {
>     std::cout << "integer" << std::endl;
> }
>
>

> ...
>


> And if you don't like the `enable_if` syntax (no one does),
>


http://flamingdangerzone.com/cxx11/2012/06/01/almost-static-if.html  makes
enable_if more concept-like:

template <typename Condition>using EnableIf = typename
std::enable_if<Condition::value, detail::enabler>::type;
template <typename T, EnableIf<is_scalable<T>>...>T twice(T t) { return 2*t; }


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

--001a11c2a0f476f78704f59afeb3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On Thu, Mar 27, 2014 at 1:58 PM, Zhihao Yuan <span dir=3D"ltr">&lt;=
<a href=3D"mailto:zy@miator.net" target=3D"_blank">zy@miator.net</a>&gt;</s=
pan> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex"><div class=3D""><br>
<br>
</div>Function templates can be overloaded, so you already able to<br>
<br>
template &lt;typename T&gt;<br>
auto Print(T) -&gt; std::enable_if_t&lt;std::is_integral&lt;T&gt;{}&gt;<br>
{<br>
=A0 =A0 std::cout &lt;&lt; &quot;integer&quot; &lt;&lt; std::endl;<br>
}<br>
<br>
</blockquote><div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margi=
n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex=
">...<br></blockquote><div>=A0</div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">

And if you don&#39;t like the `enable_if` syntax (no one does),<br></blockq=
uote></div><br><br><a href=3D"http://flamingdangerzone.com/cxx11/2012/06/01=
/almost-static-if.html">http://flamingdangerzone.com/cxx11/2012/06/01/almos=
t-static-if.html</a>=A0 makes enable_if more concept-like:<br>
<br><pre><code class=3D""><span class=3D"">template</span> <span class=3D""=
>&lt;</span><span class=3D"">typename</span> <span class=3D"">Condition</sp=
an><span class=3D"">&gt;</span>
<span class=3D"">using</span> <span class=3D"">EnableIf</span> <span class=
=3D"">=3D</span> <span class=3D"">typename</span> <span class=3D"">std</spa=
n><span class=3D"">::</span><span class=3D"">enable_if</span><span class=3D=
"">&lt;</span><span class=3D"">Condition</span><span class=3D"">::</span><s=
pan class=3D"">value</span><span class=3D"">,</span> <span class=3D"">detai=
l</span><span class=3D"">::</span><span class=3D"">enabler</span><span clas=
s=3D"">&gt;::</span><span class=3D"">type</span><span class=3D"">;</span>

<span class=3D"">template</span> <span class=3D"">&lt;</span><span class=3D=
"">typename</span> <span class=3D"">T</span><span class=3D"">, </span><span=
 class=3D"">EnableIf</span><span class=3D"">&lt;</span><span class=3D"">is_=
scalable</span><span class=3D"">&lt;</span><span class=3D"">T</span><span c=
lass=3D"">&gt;&gt;</span><span class=3D"">...</span><span class=3D"">&gt;</=
span>
<span class=3D"">T</span> <span class=3D"">twice</span><span class=3D"">(</=
span><span class=3D"">T</span> <span class=3D"">t</span><span class=3D"">)<=
/span> <span class=3D"">{</span> <span class=3D"">return</span> <span class=
=3D"">2</span><span class=3D"">*</span><span class=3D"">t</span><span class=
=3D"">;</span> <span class=3D"">}</span></code></pre>
<br></div><div class=3D"gmail_extra">Tony<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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a11c2a0f476f78704f59afeb3--

.


Author: Tony V E <tvaneerd@gmail.com>
Date: Thu, 27 Mar 2014 14:48:38 -0400
Raw View
--089e0149430885dd0104f59b08f7
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Mar 27, 2014 at 2:45 PM, Peter Kondratyuk <pkondratyuk@gmail.com>wrote:

> @ Zhihao
>
> Thanks, I didn't know about this proposed new syntax... This looks like
> it's usable, but still feels like an overkill subjectively to me. Do you
> know when they plan to introduce it?
>
>
> template <typename T>
> constexpr bool Float = is_one_of_v<T, <double, float, complex>>;
>
> void Print(Float{T} v) {}  // tentative new terse syntax
>
> --
>

The real question is, once you have Concepts, do you still want "ad hoc"
type-groups?  If { int, foo, bar } all behave somehow similar, there is
probably a Concept lurking there.  It is probably best to actually take the
time to explicitly state what the similarities are and what assumptions the
templatized functions are making.

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

--089e0149430885dd0104f59b08f7
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On Thu, Mar 27, 2014 at 2:45 PM, Peter Kondratyuk <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:pkondratyuk@gmail.com" target=3D"_blank">pkondratyuk=
@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">@ Zhihao<br><br>Thanks, I d=
idn&#39;t know about this proposed new syntax... This looks like it&#39;s u=
sable, but still feels like an overkill subjectively to me. Do you know whe=
n they plan to introduce it?<div class=3D"">
<br><br>template &lt;typename T&gt;
<br>constexpr bool Float =3D is_one_of_v&lt;T, &lt;double, float, complex&g=
t;&gt;;=A0
<br>
<br></div><div class=3D"">void Print(Float{T} v) {} =A0// tentative new ter=
se syntax<br></div></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br></div></div></blockquote><div><br></div><div>The real question is, o=
nce you have Concepts, do you still want &quot;ad hoc&quot; type-groups?=A0=
 If { int, foo, bar } all behave somehow similar, there is probably a Conce=
pt lurking there.=A0 It is probably best to actually take the time to expli=
citly state what the similarities are and what assumptions the templatized =
functions are making.<br>
<br></div><div>Tony<br></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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--089e0149430885dd0104f59b08f7--

.


Author: Zhihao Yuan <zy@miator.net>
Date: Thu, 27 Mar 2014 15:06:20 -0400
Raw View
On Thu, Mar 27, 2014 at 2:45 PM, Peter Kondratyuk <pkondratyuk@gmail.com> wrote:
> @ Zhihao
>
> Thanks, I didn't know about this proposed new syntax... This looks like it's
> usable, but still feels like an overkill subjectively to me. Do you know
> when they plan to introduce it?

Typelist targets C++17; concepts-lite appears earlier as a TS,
later in C++17.

Even without a language supported typelist, you can always
use MPL:

 template <typename T>
 constexpr bool Integral = mpl::contains<mpl::vector<int, long, etc...>, T>;
 // Spam Andrew to get a `concept Name = ` syntax

Anyway, it comes soon.

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/

--

---
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: Zhihao Yuan <zy@miator.net>
Date: Thu, 27 Mar 2014 15:10:22 -0400
Raw View
On Thu, Mar 27, 2014 at 3:06 PM, Zhihao Yuan <zy@miator.net> wrote:
>  template <typename T>
>  constexpr bool Integral = mpl::contains<mpl::vector<int, long, etc...>, T>;

Oops, missed ::type::value.  Hope a new MPL can cooperate with
C++14 better.

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/

--

---
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: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Thu, 27 Mar 2014 12:36:13 -0700
Raw View
--047d7b4728001ce68204f59bb526
Content-Type: text/plain; charset=UTF-8

>Respectfully, I don't think you understand the essence of the problem, so
I'll rephrase it. Without code duplication, it's currently not possible to
create specializations to behave identically for several of types (not
necessarily related types).

Do you have an example that demonstrates this condition?

Billy O'Neal
https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
http://stackoverflow.com/users/82320/billy-oneal


On Thu, Mar 27, 2014 at 11:30 AM, Peter Kondratyuk <pkondratyuk@gmail.com>wrote:

> @ Billy
>
> The problem with overloads is still there! In your example it's just
> hidden by the ability of the compiler to upconvert int to __int64. But what
> if I can't have the argument be converted to the longest type, and actually
> need the specialization for each of those types that have to behave
> identically? For example, what if I am looking for the sizeof() of the
> argument passed to the function?
>
> Respectfully, I don't think you understand the essence of the problem, so
> I'll rephrase it. Without code duplication, it's currently not possible to
> create specializations to behave identically for several of types (not
> necessarily related types). Say I need one specialization for types {int,
> std::string} and another specialization for types {double, complex,
> myType}. I saw the mention of "enable_if" and "is_one_of" metafunctions,
> but the syntax is pretty bad, and it generally seems like an
> overcomplicated solution (imho).
>
> Peter
>
> --
>
> ---
> 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/.
>

--

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

--047d7b4728001ce68204f59bb526
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>&gt;Respectfully, I don&#39;t think you understand th=
e essence of the problem,=20
so I&#39;ll rephrase it. Without code duplication, it&#39;s currently not=
=20
possible to create specializations to behave identically for several of=20
types (not necessarily related types).<br><br></div>Do you have an example =
that demonstrates this condition?<br></div><div class=3D"gmail_extra"><br c=
lear=3D"all"><div><div dir=3D"ltr"><div>Billy O&#39;Neal</div><div><a href=
=3D"https://bitbucket.org/BillyONeal/" target=3D"_blank">https://github.com=
/BillyONeal/</a></div>

<div><a href=3D"http://stackoverflow.com/users/82320/billy-oneal" target=3D=
"_blank">http://stackoverflow.com/users/82320/billy-oneal</a></div></div></=
div>
<br><br><div class=3D"gmail_quote">On Thu, Mar 27, 2014 at 11:30 AM, Peter =
Kondratyuk <span dir=3D"ltr">&lt;<a href=3D"mailto:pkondratyuk@gmail.com" t=
arget=3D"_blank">pkondratyuk@gmail.com</a>&gt;</span> wrote:<br><blockquote=
 class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli=
d;padding-left:1ex">

<div dir=3D"ltr">@ Billy<br><br>The problem with overloads is still there! =
In your example it&#39;s just hidden by the ability of the compiler to upco=
nvert int to __int64. But what if I can&#39;t have the argument be converte=
d to the longest type, and actually need the specialization for each of tho=
se types that have to behave identically? For example, what if I am looking=
 for the sizeof() of the argument passed to the function?<br>

<br>Respectfully, I don&#39;t think you understand the essence of the probl=
em, so I&#39;ll rephrase it. Without code duplication, it&#39;s currently n=
ot possible to create specializations to behave identically for several of =
types (not necessarily related types). Say I need one specialization for ty=
pes {int, std::string} and another specialization for types {double, comple=
x, myType}. I saw the mention of &quot;enable_if&quot; and &quot;is_one_of&=
quot; metafunctions, but the syntax is pretty bad, and it generally seems l=
ike an overcomplicated solution (imho).<span class=3D"HOEnZb"><font color=
=3D"#888888"><br>

<br>Peter<br></font></span></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--047d7b4728001ce68204f59bb526--

.


Author: Peter Kondratyuk <pkondratyuk@gmail.com>
Date: Thu, 27 Mar 2014 12:58:50 -0700 (PDT)
Raw View
------=_Part_71_1503533.1395950330476
Content-Type: text/plain; charset=UTF-8

@Billy

Sure, there are pretty typical situations where this occurs. Here's one
that I saw in production. Say you have a templated serialization function
that

1) bytewise-serializes bool, short, int, long long, float, double
2) serializes char* and std::string as an four-byte integer length and a
string of bytes for the content
3) Writes a error to an error log for all other types

Best you can do, with the current state of affairs,  is to specialize the
function for each of the types: bool, short, int, long long, float and
double. Same code, written 6 times, hence the problem!

Peter


Do you have an example that demonstrates this condition?
>
> Billy O'Neal
> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
> http://stackoverflow.com/users/82320/billy-oneal
>
>

--

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

<div dir=3D"ltr">@Billy<br><br>Sure, there are pretty typical situations wh=
ere this occurs. Here's one that I saw in production. Say you have a templa=
ted serialization function that<br><br>1) bytewise-serializes bool, short, =
int, long long, float, double<br>2) serializes char* and std::string as an =
four-byte integer length and a string of bytes for the content<br>3) Writes=
 a error to an error log for all other types<br><br>Best you can do, with t=
he current state of affairs,&nbsp; is to specialize the function for each o=
f the types: bool, short, int, long long, float and double. Same code, writ=
ten 6 times, hence the problem!<br><br>Peter<br><br><br><blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;"><div dir=3D"ltr">Do you have an example that de=
monstrates this condition?<br></div><div><br clear=3D"all"><div><div dir=3D=
"ltr"><div>Billy O'Neal</div><div><a href=3D"https://bitbucket.org/BillyONe=
al/" target=3D"_blank" onmousedown=3D"this.href=3D'https://www.google.com/u=
rl?q\75https%3A%2F%2Fbitbucket.org%2FBillyONeal%2F\46sa\75D\46sntz\0751\46u=
sg\75AFQjCNEUaaIry0cea0l0vX6ztWgwQ7_4Lg';return true;" onclick=3D"this.href=
=3D'https://www.google.com/url?q\75https%3A%2F%2Fbitbucket.org%2FBillyONeal=
%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNEUaaIry0cea0l0vX6ztWgwQ7_4Lg';return=
 true;">https://github.com/BillyONeal/</a></div>

<div><a href=3D"http://stackoverflow.com/users/82320/billy-oneal" target=3D=
"_blank" onmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%3A%=
2F%2Fstackoverflow.com%2Fusers%2F82320%2Fbilly-oneal\46sa\75D\46sntz\0751\4=
6usg\75AFQjCNHY_gA133vyg0yY-U2PNMVA8cCSBg';return true;" onclick=3D"this.hr=
ef=3D'http://www.google.com/url?q\75http%3A%2F%2Fstackoverflow.com%2Fusers%=
2F82320%2Fbilly-oneal\46sa\75D\46sntz\0751\46usg\75AFQjCNHY_gA133vyg0yY-U2P=
NMVA8cCSBg';return true;">http://stackoverflow.com/<wbr>users/82320/billy-o=
neal</a></div></div></div>
<br></div>
</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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_71_1503533.1395950330476--

.


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Thu, 27 Mar 2014 15:39:40 -0500
Raw View
--047d7bdc9e02fbbcde04f59c97a3
Content-Type: text/plain; charset=ISO-8859-1

On 27 March 2014 14:58, Peter Kondratyuk <pkondratyuk@gmail.com> wrote:

> @Billy
>
> Sure, there are pretty typical situations where this occurs. Here's one
> that I saw in production. Say you have a templated serialization function
> that
>
> 1) bytewise-serializes bool, short, int, long long, float, double
> 2) serializes char* and std::string as an four-byte integer length and a
> string of bytes for the content
> 3) Writes a error to an error log for all other types
>

Why wouldn't I just use tag dispatching or enable_if on a type_trait like
is_arithmetic for (1)?  How do you implement (2) in one templated function?

I don't see why concepts lite (by C++17 or sooner) and type traits (now)
won't already cover the design space.
--
 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/.

--047d7bdc9e02fbbcde04f59c97a3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On 27 March 2014 14:58, Peter Kondratyuk <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:pkondratyuk@gmail.com" target=3D"_blank">pkondratyuk=
@gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=
=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">@Billy<br><br>Sure, there a=
re pretty typical situations where this occurs. Here&#39;s one that I saw i=
n production. Say you have a templated serialization function that<br>

<br>1) bytewise-serializes bool, short, int, long long, float, double<br>2)=
 serializes char* and std::string as an four-byte integer length and a stri=
ng of bytes for the content<br>3) Writes a error to an error log for all ot=
her types<br>

</div></blockquote><div><br></div><div>Why wouldn&#39;t I just use tag disp=
atching or enable_if on a type_trait like is_arithmetic for (1)? =A0How do =
you implement (2) in one templated function?</div><div><br></div><div>I don=
&#39;t see why concepts lite (by C++17 or sooner) and type traits (now) won=
&#39;t already cover the design space.</div>

</div>-- <br>=A0Nevin &quot;:-)&quot; Liber=A0 &lt;mailto:<a href=3D"mailto=
:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com</a>&gt;=
=A0 (847) 691-1404
</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--047d7bdc9e02fbbcde04f59c97a3--

.


Author: Peter Kondratyuk <pkondratyuk@gmail.com>
Date: Thu, 27 Mar 2014 14:04:46 -0700 (PDT)
Raw View
------=_Part_5_17255434.1395954286375
Content-Type: text/plain; charset=UTF-8

@ Nevin
>
>
> Why wouldn't I just use tag dispatching or enable_if on a type_trait like
> is_arithmetic for (1)?  How do you implement (2) in one templated function?
>

is_arithmetic is insufficient for (1), it will cover all arithmetic types.
I need only those listed types to be included, not char or unsigned int for
example. (2) will require two specializations, but it's not the point. The
point is to avoid code duplication for the types listed in (1), while also
keeping to requirement (3).

is_arithmetic() and similar tests are going in the right direction, but
what I am saying is that there should be a way to specialize templates for
a list of types, not only those types that are selectable by tests like
is_arithmetic().

Cafeteria analogy: I know what I want, I want this template specialized for
carrots, green peas and beef, not is_vegetable() or is_meat().

--

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

<div dir=3D"ltr">@ Nevin<blockquote class=3D"gmail_quote" style=3D"margin: =
0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div d=
ir=3D"ltr"><div><div class=3D"gmail_quote"><div><br></div><div>Why wouldn't=
 I just use tag dispatching or enable_if on a type_trait like is_arithmetic=
 for (1)? &nbsp;How do you implement (2) in one templated function?</div></=
div></div></div></blockquote><div><br>is_arithmetic is insufficient for (1)=
, it will cover all arithmetic types. I need only those listed types to be =
included, not char or unsigned int for example. (2) will require two specia=
lizations, but it's not the point. The point is to avoid code duplication f=
or the types listed in (1), while also keeping to requirement (3).<br><br>i=
s_arithmetic() and similar tests are going in the right direction, but what=
 I am saying is that there should be a way to specialize templates for a li=
st of types, not only those types that are selectable by tests like is_arit=
hmetic().<br><br>Cafeteria analogy: I know what I want, I want this templat=
e specialized for carrots, green peas and beef, not is_vegetable() or is_me=
at().<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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_5_17255434.1395954286375--

.


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Thu, 27 Mar 2014 16:41:45 -0500
Raw View
--047d7bdc9e021a7d3804f59d7629
Content-Type: text/plain; charset=ISO-8859-1

On 27 March 2014 16:04, Peter Kondratyuk <pkondratyuk@gmail.com> wrote:

> is_arithmetic is insufficient for (1), it will cover all arithmetic types.
>

So use a type list.  Off the top of my head:

template<typename U, typename TL>

struct in_typelist;


template<typename U, template<typename...> class TL>

struct in_typelist<U, TL<>> : std::false_type {};


template<typename U, template<typename...> class TL, typename T0, typename...
Ts>

struct in_typelist<U, TL<T0, Ts...>> : in_typelist<U, TL<Ts...>> {};


template<typename U, template<typename...> class TL, typename... Ts>

struct in_typelist<U, TL<U, Ts...>> : std::true_type {};


template<typename...>

struct types;


 I need only those listed types to be included, not char or unsigned int
> for example. (2) will require two specializations, but it's not the point.
>

It is the point.  Your proposal has very limited use cases, and the moment
you need to do something "slightly different", you end up having to fall
back on specializations or overloading.

is_arithmetic() and similar tests are going in the right direction, but
> what I am saying is that there should be a way to specialize templates for
> a list of types, not only those types that are selectable by tests like
> is_arithmetic().
>

in_typelist<T, types<bool, short, int, long long, float, double>> pretty
much accomplishes it.
--
 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/.

--047d7bdc9e021a7d3804f59d7629
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On 27 March 2014 16:04, Peter Kondratyuk <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:pkondratyuk@gmail.com" target=3D"_blank">pkondratyuk=
@gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=
=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr"><div>is_arithmetic is insufficient for (1=
), it will cover all arithmetic types.</div>

</div></blockquote><div><br></div><div>So use a type list. =A0Off the top o=
f my head:</div><div><br></div><div><p style=3D"margin:0px;font-size:10px;f=
ont-family:&#39;Source Code Pro&#39;;color:rgb(39,180,28);background-color:=
rgb(254,244,156)">

template<span style=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=3D"=
color:rgb(0,0,0)"> U, </span>typename<span style=3D"color:rgb(0,0,0)"> TL&g=
t;=A0</span></p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">st=
ruct</span> in_typelist;</p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156);min-height:13px"><br></p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;color:rgb(39,180,28);background-color:rgb(254,244,156)">template<span styl=
e=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=3D"color:rgb(0,0,0)">=
 U, </span>template<span style=3D"color:rgb(0,0,0)">&lt;</span>typename<spa=
n style=3D"color:rgb(0,0,0)">...&gt; </span>class<span style=3D"color:rgb(0=
,0,0)"> TL&gt;=A0</span></p>


<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">st=
ruct</span> in_typelist&lt;U, TL&lt;&gt;&gt; : std::false_type {};=A0</p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156);min-height:13px"><br></p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;color:rgb(39,180,28);background-color:rgb(254,244,156)">template<span styl=
e=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=3D"color:rgb(0,0,0)">=
 U, </span>template<span style=3D"color:rgb(0,0,0)">&lt;</span>typename<spa=
n style=3D"color:rgb(0,0,0)">...&gt; </span>class<span style=3D"color:rgb(0=
,0,0)"> TL, </span>typename<span style=3D"color:rgb(0,0,0)"> T0, </span>typ=
ename<span style=3D"color:rgb(0,0,0)">... Ts&gt;=A0</span></p>


<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">st=
ruct</span> in_typelist&lt;U, TL&lt;T0, Ts...&gt;&gt; : in_typelist&lt;U, T=
L&lt;Ts...&gt;&gt; {};=A0</p>


<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156);min-height:13px"><br></p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;color:rgb(39,180,28);background-color:rgb(254,244,156)">template<span styl=
e=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=3D"color:rgb(0,0,0)">=
 U, </span>template<span style=3D"color:rgb(0,0,0)">&lt;</span>typename<spa=
n style=3D"color:rgb(0,0,0)">...&gt; </span>class<span style=3D"color:rgb(0=
,0,0)"> TL, </span>typename<span style=3D"color:rgb(0,0,0)">... Ts&gt;=A0</=
span></p>


<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">st=
ruct</span> in_typelist&lt;U, TL&lt;U, Ts...&gt;&gt; : std::true_type {};=
=A0</p>


<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156);min-height:13px"><br></p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;color:rgb(39,180,28);background-color:rgb(254,244,156)">template<span styl=
e=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=3D"color:rgb(0,0,0)">=
....&gt;</span></p>


<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">st=
ruct</span> types;</p></div><div><br></div><div></div><br><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;bo=
rder-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir=3D"ltr"><div> I need only those listed types to be included, not c=
har or unsigned int for example. (2) will require two specializations, but =
it&#39;s not the point. </div></div></blockquote><div><br></div><div>It is =
the point. =A0Your proposal has very limited use cases, and the moment you =
need to do something &quot;slightly different&quot;, you end up having to f=
all back on specializations or overloading.</div>

<div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0p=
x 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-lef=
t-style:solid;padding-left:1ex"><div dir=3D"ltr"><div>is_arithmetic() and s=
imilar tests are going in the right direction, but what I am saying is that=
 there should be a way to specialize templates for a list of types, not onl=
y those types that are selectable by tests like is_arithmetic().<br>

</div></div></blockquote><div><br></div><div>in_typelist&lt;T, types&lt;<sp=
an style=3D"font-family:arial,sans-serif;font-size:12.499999046325684px">bo=
ol, short, int, long long, float, double&gt;&gt; pretty much accomplishes i=
t.</span></div>

</div>-- <br>=A0Nevin &quot;:-)&quot; Liber=A0 &lt;mailto:<a href=3D"mailto=
:nevin@eviloverlord.com" target=3D"_blank">nevin@eviloverlord.com</a>&gt;=
=A0 (847) 691-1404
</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--047d7bdc9e021a7d3804f59d7629--

.


Author: Peter Kondratyuk <pkondratyuk@gmail.com>
Date: Thu, 27 Mar 2014 15:24:01 -0700 (PDT)
Raw View
------=_Part_57_9646249.1395959042080
Content-Type: text/plain; charset=UTF-8

I see that apparently it can be done, but I don't understand your code...
The use case is very simple - specialize the template for types A, B, C but
no other types.

Why can't this use case be accomplished without the standard library,
std::true_type and some horrible syntax? I think it's a sign of a serious
deficiency, when something very simple needs to be done in an unnecessarily
complex way. Hence my suggestion.




On Thursday, March 27, 2014 11:41:45 PM UTC+2, Nevin ":-)" Liber wrote:
>
> On 27 March 2014 16:04, Peter Kondratyuk <pkond...@gmail.com <javascript:>
> > wrote:
>
>> is_arithmetic is insufficient for (1), it will cover all arithmetic types.
>>
>
> So use a type list.  Off the top of my head:
>
> template<typename U, typename TL>
>
> struct in_typelist;
>
>
> template<typename U, template<typename...> class TL>
>
> struct in_typelist<U, TL<>> : std::false_type {};
>
>
> template<typename U, template<typename...> class TL, typename T0, typename...
> Ts>
>
> struct in_typelist<U, TL<T0, Ts...>> : in_typelist<U, TL<Ts...>> {};
>
>
> template<typename U, template<typename...> class TL, typename... Ts>
>
> struct in_typelist<U, TL<U, Ts...>> : std::true_type {};
>
>
> template<typename...>
>
> struct types;
>
>
>  I need only those listed types to be included, not char or unsigned int
>> for example. (2) will require two specializations, but it's not the point.
>>
>
> It is the point.  Your proposal has very limited use cases, and the moment
> you need to do something "slightly different", you end up having to fall
> back on specializations or overloading.
>
> is_arithmetic() and similar tests are going in the right direction, but
>> what I am saying is that there should be a way to specialize templates for
>> a list of types, not only those types that are selectable by tests like
>> is_arithmetic().
>>
>
> in_typelist<T, types<bool, short, int, long long, float, double>> pretty
> much accomplishes it.
> --
>  Nevin ":-)" Liber  <mailto:ne...@eviloverlord.com <javascript:>>  (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/.

------=_Part_57_9646249.1395959042080
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I see that apparently it can be done, but I don't understa=
nd your code... The use case is very simple - specialize the template for t=
ypes A, B, C but no other types.<br><br>Why can't this use case be accompli=
shed without the standard library, std::true_type and some horrible syntax?=
 I think it's a sign of a serious deficiency, when something very simple ne=
eds to be done in an unnecessarily complex way. Hence my suggestion.<br><br=
><br><br><br>On Thursday, March 27, 2014 11:41:45 PM UTC+2, Nevin ":-)" Lib=
er 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">On 2=
7 March 2014 16:04, Peter Kondratyuk <span dir=3D"ltr">&lt;<a href=3D"javas=
cript:" target=3D"_blank" gdf-obfuscated-mailto=3D"byCdG73mgewJ" onmousedow=
n=3D"this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'javasc=
ript:';return true;">pkond...@gmail.com</a>&gt;</span> wrote:<br><div><div =
class=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr"><div>is_arithmetic is insufficient for (1=
), it will cover all arithmetic types.</div>

</div></blockquote><div><br></div><div>So use a type list. &nbsp;Off the to=
p of my head:</div><div><br></div><div><p style=3D"margin:0px;font-size:10p=
x;font-family:'Source Code Pro';color:rgb(39,180,28);background-color:rgb(2=
54,244,156)">

template<span style=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=3D"=
color:rgb(0,0,0)"> U, </span>typename<span style=3D"color:rgb(0,0,0)"> TL&g=
t;&nbsp;</span></p>
<p style=3D"margin:0px;font-size:10px;font-family:'Source Code Pro';backgro=
und-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">struct</sp=
an> in_typelist;</p>
<p style=3D"margin:0px;font-size:10px;font-family:'Source Code Pro';backgro=
und-color:rgb(254,244,156);min-height:13px"><br></p>
<p style=3D"margin:0px;font-size:10px;font-family:'Source Code Pro';color:r=
gb(39,180,28);background-color:rgb(254,244,156)">template<span style=3D"col=
or:rgb(0,0,0)">&lt;</span>typename<span style=3D"color:rgb(0,0,0)"> U, </sp=
an>template<span style=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=
=3D"color:rgb(0,0,0)">...&gt; </span>class<span style=3D"color:rgb(0,0,0)">=
 TL&gt;&nbsp;</span></p>


<p style=3D"margin:0px;font-size:10px;font-family:'Source Code Pro';backgro=
und-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">struct</sp=
an> in_typelist&lt;U, TL&lt;&gt;&gt; : std::false_type {};&nbsp;</p>
<p style=3D"margin:0px;font-size:10px;font-family:'Source Code Pro';backgro=
und-color:rgb(254,244,156);min-height:13px"><br></p>
<p style=3D"margin:0px;font-size:10px;font-family:'Source Code Pro';color:r=
gb(39,180,28);background-color:rgb(254,244,156)">template<span style=3D"col=
or:rgb(0,0,0)">&lt;</span>typename<span style=3D"color:rgb(0,0,0)"> U, </sp=
an>template<span style=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=
=3D"color:rgb(0,0,0)">...&gt; </span>class<span style=3D"color:rgb(0,0,0)">=
 TL, </span>typename<span style=3D"color:rgb(0,0,0)"> T0, </span>typename<s=
pan style=3D"color:rgb(0,0,0)">... Ts&gt;&nbsp;</span></p>


<p style=3D"margin:0px;font-size:10px;font-family:'Source Code Pro';backgro=
und-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">struct</sp=
an> in_typelist&lt;U, TL&lt;T0, Ts...&gt;&gt; : in_typelist&lt;U, TL&lt;Ts.=
...&gt;&gt; {};&nbsp;</p>


<p style=3D"margin:0px;font-size:10px;font-family:'Source Code Pro';backgro=
und-color:rgb(254,244,156);min-height:13px"><br></p>
<p style=3D"margin:0px;font-size:10px;font-family:'Source Code Pro';color:r=
gb(39,180,28);background-color:rgb(254,244,156)">template<span style=3D"col=
or:rgb(0,0,0)">&lt;</span>typename<span style=3D"color:rgb(0,0,0)"> U, </sp=
an>template<span style=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=
=3D"color:rgb(0,0,0)">...&gt; </span>class<span style=3D"color:rgb(0,0,0)">=
 TL, </span>typename<span style=3D"color:rgb(0,0,0)">... Ts&gt;&nbsp;</span=
></p>


<p style=3D"margin:0px;font-size:10px;font-family:'Source Code Pro';backgro=
und-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">struct</sp=
an> in_typelist&lt;U, TL&lt;U, Ts...&gt;&gt; : std::true_type {};&nbsp;</p>


<p style=3D"margin:0px;font-size:10px;font-family:'Source Code Pro';backgro=
und-color:rgb(254,244,156);min-height:13px"><br></p>
<p style=3D"margin:0px;font-size:10px;font-family:'Source Code Pro';color:r=
gb(39,180,28);background-color:rgb(254,244,156)">template<span style=3D"col=
or:rgb(0,0,0)">&lt;</span>typename<span style=3D"color:rgb(0,0,0)">...&gt;<=
/span></p>


<p style=3D"margin:0px;font-size:10px;font-family:'Source Code Pro';backgro=
und-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">struct</sp=
an> types;</p></div><div><br></div><div></div><br><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-lef=
t-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir=3D"ltr"><div> I need only those listed types to be included, not c=
har or unsigned int for example. (2) will require two specializations, but =
it's not the point. </div></div></blockquote><div><br></div><div>It is the =
point. &nbsp;Your proposal has very limited use cases, and the moment you n=
eed to do something "slightly different", you end up having to fall back on=
 specializations or overloading.</div>

<div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0p=
x 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-lef=
t-style:solid;padding-left:1ex"><div dir=3D"ltr"><div>is_arithmetic() and s=
imilar tests are going in the right direction, but what I am saying is that=
 there should be a way to specialize templates for a list of types, not onl=
y those types that are selectable by tests like is_arithmetic().<br>

</div></div></blockquote><div><br></div><div>in_typelist&lt;T, types&lt;<sp=
an style=3D"font-family:arial,sans-serif;font-size:12.499999046325684px">bo=
ol, short, int, long long, float, double&gt;&gt; pretty much accomplishes i=
t.</span></div>

</div>-- <br>&nbsp;Nevin ":-)" Liber&nbsp; &lt;mailto:<a href=3D"javascript=
:" target=3D"_blank" gdf-obfuscated-mailto=3D"byCdG73mgewJ" onmousedown=3D"=
this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'javascript:=
';return true;">ne...@eviloverlord.com</a><wbr>&gt;&nbsp; (847) 691-1404
</div></div>
</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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_57_9646249.1395959042080--

.


Author: Nevin Liber <nevin@eviloverlord.com>
Date: Thu, 27 Mar 2014 17:49:56 -0500
Raw View
--047d7bdca046e391d104f59e6970
Content-Type: text/plain; charset=ISO-8859-1

On 27 March 2014 17:24, Peter Kondratyuk <pkondratyuk@gmail.com> wrote:

> I see that apparently it can be done, but I don't understand your code...
> The use case is very simple - specialize the template for types A, B, C but
> no other types.
>

It is the same as any other type_trait.  If T is in the type list types<bool,
short, int, long long, float, double> , then in_typelist derives from
std::true_type; otherwise, it derives from std::false_type.  From that you
can use either tag dispatching or enable_if.


> Why can't this use case be accomplished without the standard library,
> std::true_type and some horrible syntax? I think it's a sign of a serious
> deficiency, when something very simple needs to be done in an unnecessarily
> complex way. Hence my suggestion.
>

If you think adding a language feature is simpler than a couple of lines of
library code, then it is time for me to bow out of this discussion.  Good
luck presenting your proposal at a future meeting.

>
>
>
>
> On Thursday, March 27, 2014 11:41:45 PM UTC+2, Nevin ":-)" Liber wrote:
>>
>> On 27 March 2014 16:04, Peter Kondratyuk <pkond...@gmail.com> wrote:
>>
>>> is_arithmetic is insufficient for (1), it will cover all arithmetic
>>> types.
>>>
>>
>> So use a type list.  Off the top of my head:
>>
>> template<typename U, typename TL>
>>
>> struct in_typelist;
>>
>>
>> template<typename U, template<typename...> class TL>
>>
>> struct in_typelist<U, TL<>> : std::false_type {};
>>
>>
>> template<typename U, template<typename...> class TL, typename T0,
>> typename... Ts>
>>
>> struct in_typelist<U, TL<T0, Ts...>> : in_typelist<U, TL<Ts...>> {};
>>
>>
>> template<typename U, template<typename...> class TL, typename... Ts>
>>
>> struct in_typelist<U, TL<U, Ts...>> : std::true_type {};
>>
>>
>> template<typename...>
>>
>> struct types;
>>
>>
>>  I need only those listed types to be included, not char or unsigned int
>>> for example. (2) will require two specializations, but it's not the point.
>>>
>>
>> It is the point.  Your proposal has very limited use cases, and the
>> moment you need to do something "slightly different", you end up having to
>> fall back on specializations or overloading.
>>
>> is_arithmetic() and similar tests are going in the right direction, but
>>> what I am saying is that there should be a way to specialize templates for
>>> a list of types, not only those types that are selectable by tests like
>>> is_arithmetic().
>>>
>>
>> in_typelist<T, types<bool, short, int, long long, float, double>> pretty
>> much accomplishes it.
>> --
>>  Nevin ":-)" Liber  <mailto:ne...@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/.
>



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

--047d7bdca046e391d104f59e6970
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On 27 March 2014 17:24, Peter Kondratyuk <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:pkondratyuk@gmail.com" target=3D"_blank">pkondratyuk=
@gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=
=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr">I see that apparently it can be done, but=
 I don&#39;t understand your code... The use case is very simple - speciali=
ze the template for types A, B, C but no other types.<br>

</div></blockquote><div><br></div><div>It is the same as any other type_tra=
it. =A0If T is in the type list=A0<span style=3D"color:rgb(80,0,80)">types&=
lt;</span><span style=3D"color:rgb(80,0,80);font-family:arial,sans-serif;fo=
nt-size:12.499999046325684px">bool, short, int, long long, float, double&gt=
;</span>=A0, then in_typelist derives from std::true_type; otherwise, it de=
rives from std::false_type. =A0From that you can use either tag dispatching=
 or enable_if.</div>

<div>=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px=
 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left=
-style:solid;padding-left:1ex"><div dir=3D"ltr">Why can&#39;t this use case=
 be accomplished without the standard library, std::true_type and some horr=
ible syntax? I think it&#39;s a sign of a serious deficiency, when somethin=
g very simple needs to be done in an unnecessarily complex way. Hence my su=
ggestion.<br>

</div></blockquote><div><br></div><div>If you think adding a language featu=
re is simpler than a couple of lines of library code, then it is time for m=
e to bow out of this discussion. =A0Good luck presenting your proposal at a=
 future meeting.=A0</div>

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr"><br><br><br><br>On Thursday, March 27, 20=
14 11:41:45 PM UTC+2, Nevin &quot;:-)&quot; Liber wrote:<blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;bo=
rder-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div dir=3D"ltr"><div><div class=3D"h5">On 27 March 2014 16:04, Peter Kondr=
atyuk <span dir=3D"ltr">&lt;<a>pkond...@gmail.com</a>&gt;</span> wrote:<br>=
</div></div><div><div><div class=3D"h5"><div class=3D"gmail_quote">

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr"><div>is_arithmetic is insufficient for (1=
), it will cover all arithmetic types.</div>



</div></blockquote><div><br></div><div>So use a type list. =A0Off the top o=
f my head:</div><div><br></div><div><p style=3D"margin:0px;font-size:10px;f=
ont-family:&#39;Source Code Pro&#39;;color:rgb(39,180,28);background-color:=
rgb(254,244,156)">



template<span style=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=3D"=
color:rgb(0,0,0)"> U, </span>typename<span style=3D"color:rgb(0,0,0)"> TL&g=
t;=A0</span></p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">st=
ruct</span> in_typelist;</p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156);min-height:13px"><br></p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;color:rgb(39,180,28);background-color:rgb(254,244,156)">template<span styl=
e=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=3D"color:rgb(0,0,0)">=
 U, </span>template<span style=3D"color:rgb(0,0,0)">&lt;</span>typename<spa=
n style=3D"color:rgb(0,0,0)">...&gt; </span>class<span style=3D"color:rgb(0=
,0,0)"> TL&gt;=A0</span></p>




<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">st=
ruct</span> in_typelist&lt;U, TL&lt;&gt;&gt; : std::false_type {};=A0</p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156);min-height:13px"><br></p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;color:rgb(39,180,28);background-color:rgb(254,244,156)">template<span styl=
e=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=3D"color:rgb(0,0,0)">=
 U, </span>template<span style=3D"color:rgb(0,0,0)">&lt;</span>typename<spa=
n style=3D"color:rgb(0,0,0)">...&gt; </span>class<span style=3D"color:rgb(0=
,0,0)"> TL, </span>typename<span style=3D"color:rgb(0,0,0)"> T0, </span>typ=
ename<span style=3D"color:rgb(0,0,0)">... Ts&gt;=A0</span></p>




<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">st=
ruct</span> in_typelist&lt;U, TL&lt;T0, Ts...&gt;&gt; : in_typelist&lt;U, T=
L&lt;Ts...&gt;&gt; {};=A0</p>




<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156);min-height:13px"><br></p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;color:rgb(39,180,28);background-color:rgb(254,244,156)">template<span styl=
e=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=3D"color:rgb(0,0,0)">=
 U, </span>template<span style=3D"color:rgb(0,0,0)">&lt;</span>typename<spa=
n style=3D"color:rgb(0,0,0)">...&gt; </span>class<span style=3D"color:rgb(0=
,0,0)"> TL, </span>typename<span style=3D"color:rgb(0,0,0)">... Ts&gt;=A0</=
span></p>




<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">st=
ruct</span> in_typelist&lt;U, TL&lt;U, Ts...&gt;&gt; : std::true_type {};=
=A0</p>




<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156);min-height:13px"><br></p>
<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;color:rgb(39,180,28);background-color:rgb(254,244,156)">template<span styl=
e=3D"color:rgb(0,0,0)">&lt;</span>typename<span style=3D"color:rgb(0,0,0)">=
....&gt;</span></p>




<p style=3D"margin:0px;font-size:10px;font-family:&#39;Source Code Pro&#39;=
;background-color:rgb(254,244,156)"><span style=3D"color:rgb(39,180,28)">st=
ruct</span> types;</p></div><div><br></div><div></div><br><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;bo=
rder-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">



<div dir=3D"ltr"><div> I need only those listed types to be included, not c=
har or unsigned int for example. (2) will require two specializations, but =
it&#39;s not the point. </div></div></blockquote><div><br></div><div>It is =
the point. =A0Your proposal has very limited use cases, and the moment you =
need to do something &quot;slightly different&quot;, you end up having to f=
all back on specializations or overloading.</div>



<div><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0p=
x 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-lef=
t-style:solid;padding-left:1ex"><div dir=3D"ltr"><div>is_arithmetic() and s=
imilar tests are going in the right direction, but what I am saying is that=
 there should be a way to specialize templates for a list of types, not onl=
y those types that are selectable by tests like is_arithmetic().<br>



</div></div></blockquote><div><br></div><div>in_typelist&lt;T, types&lt;<sp=
an style=3D"font-family:arial,sans-serif;font-size:12.499999046325684px">bo=
ol, short, int, long long, float, double&gt;&gt; pretty much accomplishes i=
t.</span></div>



</div>-- <br></div></div>=A0Nevin &quot;:-)&quot; Liber=A0 &lt;mailto:<a>ne=
....@eviloverlord.com</a><u></u>&gt;=A0 <a href=3D"tel:%28847%29%20691-1404"=
 value=3D"+18476911404" target=3D"_blank">(847) 691-1404</a>
</div></div>
</blockquote></div><div class=3D""><div class=3D"h5">

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>=
=A0Nevin &quot;:-)&quot; Liber=A0 &lt;mailto:<a href=3D"mailto:nevin@evilov=
erlord.com" target=3D"_blank">nevin@eviloverlord.com</a>&gt;=A0 (847) 691-1=
404
</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--047d7bdca046e391d104f59e6970--

.


Author: Peter Kondratyuk <pkondratyuk@gmail.com>
Date: Thu, 27 Mar 2014 16:06:52 -0700 (PDT)
Raw View
------=_Part_61_2357812.1395961612467
Content-Type: text/plain; charset=UTF-8

I must admit that I don't know the process for introducing new language
features. I just see the problem:

1) Specialize for type A, and no other - simple.
2) Specialize for types A, B and C, and no other - really complex, requires
standard library with its type_traits, variadic templates and a syntax that
reads like brainfuck code.


On Friday, March 28, 2014 12:49:56 AM UTC+2, Nevin ":-)" Liber wrote:
>
> On 27 March 2014 17:24, Peter Kondratyuk <pkond...@gmail.com <javascript:>
> > wrote:
>
>> I see that apparently it can be done, but I don't understand your code...
>> The use case is very simple - specialize the template for types A, B, C but
>> no other types.
>>
>
> It is the same as any other type_trait.  If T is in the type list types<bool,
> short, int, long long, float, double> , then in_typelist derives from
> std::true_type; otherwise, it derives from std::false_type.  From that you
> can use either tag dispatching or enable_if.
>
>
>> Why can't this use case be accomplished without the standard library,
>> std::true_type and some horrible syntax? I think it's a sign of a serious
>> deficiency, when something very simple needs to be done in an unnecessarily
>> complex way. Hence my suggestion.
>>
>
> If you think adding a language feature is simpler than a couple of lines
> of library code, then it is time for me to bow out of this discussion.
>  Good luck presenting your proposal at a future meeting.
>

--

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

<div dir=3D"ltr">I must admit that I don't know the process for introducing=
 new language features. I just see the problem:<br><br>1) Specialize for ty=
pe A, and no other - simple.<br>2) Specialize for types A, B and C, and no =
other - really complex, requires standard library with its type_traits, var=
iadic templates and a syntax that reads like brainfuck code.<br><br><br>On =
Friday, March 28, 2014 12:49:56 AM UTC+2, Nevin ":-)" Liber wrote:<blockquo=
te class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left:=
 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">On 27 March 2014 17:24=
, Peter Kondratyuk <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"=
_blank" gdf-obfuscated-mailto=3D"Aq0sSPksukQJ" onmousedown=3D"this.href=3D'=
javascript:';return true;" onclick=3D"this.href=3D'javascript:';return true=
;">pkond...@gmail.com</a>&gt;</span> wrote:<br><div><div class=3D"gmail_quo=
te">

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div dir=3D"ltr">I see that apparently it can be done, but=
 I don't understand your code... The use case is very simple - specialize t=
he template for types A, B, C but no other types.<br>

</div></blockquote><div><br></div><div>It is the same as any other type_tra=
it. &nbsp;If T is in the type list&nbsp;<span style=3D"color:rgb(80,0,80)">=
types&lt;</span><span style=3D"color:rgb(80,0,80);font-family:arial,sans-se=
rif;font-size:12.499999046325684px">bool, short, int, long long, float, dou=
ble&gt;</span>&nbsp;, then in_typelist derives from std::true_type; otherwi=
se, it derives from std::false_type. &nbsp;From that you can use either tag=
 dispatching or enable_if.</div>

<div>&nbsp;</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-l=
eft-style:solid;padding-left:1ex"><div dir=3D"ltr">Why can't this use case =
be accomplished without the standard library, std::true_type and some horri=
ble syntax? I think it's a sign of a serious deficiency, when something ver=
y simple needs to be done in an unnecessarily complex way. Hence my suggest=
ion.<br>

</div></blockquote><div><br></div><div>If you think adding a language featu=
re is simpler than a couple of lines of library code, then it is time for m=
e to bow out of this discussion. &nbsp;Good luck presenting your proposal a=
t a future meeting.&nbsp;</div>

</div></div></div>
</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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_61_2357812.1395961612467--

.


Author: Zhihao Yuan <zy@miator.net>
Date: Thu, 27 Mar 2014 21:39:26 -0400
Raw View
On Thu, Mar 27, 2014 at 7:06 PM, Peter Kondratyuk <pkondratyuk@gmail.com> wrote:
> I must admit that I don't know the process for introducing new language
> features. I just see the problem:
>
> 1) Specialize for type A, and no other - simple.
> 2) Specialize for types A, B and C, and no other - really complex, requires
> standard library with its type_traits, variadic templates and a syntax that
> reads like brainfuck code.

Imaging you want A, B, C, -- only if they are under 4
bytes (different arch, alignment) -- or only when they are
decayed types -- how do you add additional logic to a
typegroup?  There is reason for 2) only requires 3 names
under boost::mpl.  And we know the syntax (and diagnostics)
sucks, so we are trying...

If you are interested in the disambiguation techniques, you
are welcome to join/watch the talk I'm going to give on this
year's C++Now.  The talk is a tutorial, and does not use MPL.

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/

--

---
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: Peter Kondratyuk <pkondratyuk@gmail.com>
Date: Thu, 27 Mar 2014 21:25:22 -0700 (PDT)
Raw View
------=_Part_218_17354490.1395980723005
Content-Type: text/plain; charset=UTF-8

Thanks Zhihao,

I understand and that typegroups would have far more limited capabilities
compared to Concepts Lite. It just seems like an easy fix for this
particular simple use case. I appreciate your mention of MPL, I didn't know
about it - I'll look into it.

Peter



Imaging you want A, B, C, -- only if they are under 4
> bytes (different arch, alignment) -- or only when they are
> decayed types -- how do you add additional logic to a
> typegroup?  There is reason for 2) only requires 3 names
> under boost::mpl.  And we know the syntax (and diagnostics)
> sucks, so we are trying...
>
> If you are interested in the disambiguation techniques, you
> are welcome to join/watch the talk I'm going to give on this
> year's C++Now.  The talk is a tutorial, and does not use MPL.
>
> --
> Zhihao Yuan, ID lichray
> The best way to predict the future is to invent it.
> ___________________________________________________
> 4BSD -- http://4bsd.biz/
>

--

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

<div dir=3D"ltr">Thanks Zhihao,<br><br>I understand and that typegroups wou=
ld have far more limited capabilities compared to Concepts Lite. It just se=
ems like an easy fix for this particular simple use case. I appreciate your=
 mention of MPL, I didn't know about it - I'll look into it.<br><br>Peter<b=
r><br><br><br><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-l=
eft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Imaging you want=
 A, B, C, -- only if they are under 4
<br>bytes (different arch, alignment) -- or only when they are
<br>decayed types -- how do you add additional logic to a
<br>typegroup? &nbsp;There is reason for 2) only requires 3 names
<br>under boost::mpl. &nbsp;And we know the syntax (and diagnostics)
<br>sucks, so we are trying...
<br>
<br>If you are interested in the disambiguation techniques, you
<br>are welcome to join/watch the talk I'm going to give on this
<br>year's C++Now. &nbsp;The talk is a tutorial, and does not use MPL.
<br>
<br>--=20
<br>Zhihao Yuan, ID lichray
<br>The best way to predict the future is to invent it.
<br>______________________________<wbr>_____________________
<br>4BSD -- <a href=3D"http://4bsd.biz/" target=3D"_blank" onmousedown=3D"t=
his.href=3D'http://www.google.com/url?q\75http%3A%2F%2F4bsd.biz%2F\46sa\75D=
\46sntz\0751\46usg\75AFQjCNEEohiBBmXaBWMbzqBFWtWEgT5t9g';return true;" oncl=
ick=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2F4bsd.biz%2F\=
46sa\75D\46sntz\0751\46usg\75AFQjCNEEohiBBmXaBWMbzqBFWtWEgT5t9g';return tru=
e;">http://4bsd.biz/</a>
<br></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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_218_17354490.1395980723005--

.


Author: Tony V E <tvaneerd@gmail.com>
Date: Fri, 28 Mar 2014 11:18:26 -0400
Raw View
--001a1133be00a62f2d04f5ac36a0
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Mar 28, 2014 at 12:25 AM, Peter Kondratyuk <pkondratyuk@gmail.com>wrote:

> Thanks Zhihao,
>
> I understand and that typegroups would have far more limited capabilities
> compared to Concepts Lite. It just seems like an easy fix for this
> particular simple use case. I appreciate your mention of MPL, I didn't know
> about it - I'll look into it.
>
> Peter
>
>
It is an "easy" solution for the use case.  However:

A - is it a common (and compelling) use case?
B - is it really easy? - conceptually, yes.  But in terms of language
changes, it is not easy.  Introducing 'typegroup' as a keyword breaks any
code that was using 'typegroup' as a variable or type name, etc.  (Also, is
it worth the committee's time - which is very valuable but very limited,
with lots of other proposals to consider)

So A needs to be really strong to overcome B.  The committee doesn't like
breaking code.

And stylistically, is it worthwhile?  Do the types in the typegroup have
anything more in common than "happen to *currently* have the same syntax
for this function"?  I don't think common syntax is enough reason to
refactor something.  I think it should be refactored when they have common
semantics, and the commonality has meaning.

I had a co-worker that always ended up with base classes called "common" or
"base".  There was no meaning to a class like that.  It was just "this
stuff happens to be common".  If you can't name it well, then it probably
doesn't represent a worthwhile abstraction, and will constantly be reworked
and misused until the abstraction is found.

'typegroup' feels the same to me.  Either there is a real abstraction (like
"integral" or whatever) that deserves more than just 'typegroup' (ie
deserves a Concept) or the commonality is just happenstance and is prone to
change, error, and maintenance issues.

Anyhow, forget my stylistic reasons, it probably doesn't pass A and B
above.  I don't think it is a bad idea, and I've seen cases like you are
describing, but it isn't enough for the cost.

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

--001a1133be00a62f2d04f5ac36a0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On Fri, Mar 28, 2014 at 12:25 AM, Peter Kondratyuk <span dir=3D"ltr=
">&lt;<a href=3D"mailto:pkondratyuk@gmail.com" target=3D"_blank">pkondratyu=
k@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Thanks Zhihao,<br><br>I und=
erstand and that typegroups would have far more limited capabilities compar=
ed to Concepts Lite. It just seems like an easy fix for this particular sim=
ple use case. I appreciate your mention of MPL, I didn&#39;t know about it =
- I&#39;ll look into it.<span class=3D"HOEnZb"><font color=3D"#888888"><br>
<br>Peter</font></span><div class=3D""><br></div></div></blockquote></div><=
br></div><div class=3D"gmail_extra">It is an &quot;easy&quot; solution for =
the use case.=A0 However:<br><br></div><div class=3D"gmail_extra">A - is it=
 a common (and compelling) use case?<br>
</div><div class=3D"gmail_extra">B - is it really easy? - conceptually, yes=
..=A0 But in terms of language changes, it is not easy.=A0 Introducing &#39;=
typegroup&#39; as a keyword breaks any code that was using &#39;typegroup&#=
39; as a variable or type name, etc.=A0 (Also, is it worth the committee&#3=
9;s time - which is very valuable but very limited, with lots of other prop=
osals to consider)<br>
<br></div><div class=3D"gmail_extra">So A needs to be really strong to over=
come B.=A0 The committee doesn&#39;t like breaking code.<br></div><div clas=
s=3D"gmail_extra"><br></div><div class=3D"gmail_extra">And stylistically, i=
s it worthwhile?=A0 Do the types in the typegroup have anything more in com=
mon than &quot;happen to *currently* have the same syntax for this function=
&quot;?=A0 I don&#39;t think common syntax is enough reason to refactor som=
ething.=A0 I think it should be refactored when they have common semantics,=
 and the commonality has meaning.<br>
<br></div><div class=3D"gmail_extra">I had a co-worker that always ended up=
 with base classes called &quot;common&quot; or &quot;base&quot;.=A0 There =
was no meaning to a class like that.=A0 It was just &quot;this stuff happen=
s to be common&quot;.=A0 If you can&#39;t name it well, then it probably do=
esn&#39;t represent a worthwhile abstraction, and will constantly be rework=
ed and misused until the abstraction is found.<br>
<br></div><div class=3D"gmail_extra">&#39;typegroup&#39; feels the same to =
me.=A0 Either there is a real abstraction (like &quot;integral&quot; or wha=
tever) that deserves more than just &#39;typegroup&#39; (ie deserves a Conc=
ept) or the commonality is just happenstance and is prone to change, error,=
 and maintenance issues.<br>
<br>Anyhow, forget my stylistic reasons, it probably doesn&#39;t pass A and=
 B above.=A0 I don&#39;t think it is a bad idea, and I&#39;ve seen cases li=
ke you are describing, but it isn&#39;t enough for the cost.<br><br></div>
<div class=3D"gmail_extra">Tony<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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a1133be00a62f2d04f5ac36a0--

.


Author: Geoffrey Romer <gromer@google.com>
Date: Sat, 29 Mar 2014 17:25:16 -0700
Raw View
--047d7bf0e02816931104f5c7f899
Content-Type: text/plain; charset=UTF-8

Code duplication is just as much of a problem for class templates as for
function templates (and the workarounds are worse), but your proposal
doesn't seem to do anything for them. It also doesn't help in cases where
you're specializing a non-type template parameter.

I think code duplication in template specializations is a problem well
worth addressing, but I'd like to see it addressed comprehensively, not by
picking off ad-hoc special cases.
On Mar 27, 2014 10:11 AM, "Peter Kondratyuk" <pkondratyuk@gmail.com> wrote:

> Currently, when specializing templates for multiple types, each type has
> to have its own specialization. This requires code duplication when several
> of these specializations should behave identically.
>
> Obviously, duplicated code is bad, so I propose a new keyword,
> "typegroup", that is only used in template specializations. This keyword
> would tell the compiler to specialize the template identically for each
> type in the typegroup. The example below is a self-explanatory
> demonstration of the concept:
>
> Example:
>
> //Proposed introduction of the "typegroup" keyword into the C++ standard
> //To avoid code duplication in template specializations
>
> typegroup floatTypes {double, float, complex};
> typegroup intTypes {short, int, long long};
>
> //Templated function, but it also could be a method of a templated class
> template<typename T> void PrintValue(T value)
> {
>     //Do something for all types, except specialized one
>     printf("No specialization for this type.\n");
> }
>
> //Specialization of the function for all floatTypes
> template<> PrintValue<floatTypes>(floatTypes value)
> {
>     printf("%e \n", value);
> }
>
> //Specialization of the function for all intTypes
> template<> PrintValue<intTypes>(intTypes value)
> {
>     printf("%i \n", value);
> }
>
> --
>
> ---
> 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/.
>

--

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

--047d7bf0e02816931104f5c7f899
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p dir=3D"ltr">Code duplication is just as much of a problem for class temp=
lates as for function templates (and the workarounds are worse), but your p=
roposal doesn&#39;t seem to do anything for them. It also doesn&#39;t help =
in cases where you&#39;re specializing a non-type template parameter.</p>

<p dir=3D"ltr">I think code duplication in template specializations is a pr=
oblem well worth addressing, but I&#39;d like to see it addressed comprehen=
sively, not by picking off ad-hoc special cases.</p>
<div class=3D"gmail_quote">On Mar 27, 2014 10:11 AM, &quot;Peter Kondratyuk=
&quot; &lt;<a href=3D"mailto:pkondratyuk@gmail.com">pkondratyuk@gmail.com</=
a>&gt; wrote:<br type=3D"attribution"><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir=3D"ltr">Currently, when specializing templates for multiple types,=
 each type has to have its own specialization. This requires code duplicati=
on when several of these specializations should behave identically.<br><br>
Obviously, duplicated code is bad, so I propose a new keyword, &quot;typegr=
oup&quot;, that is only used in template specializations. This keyword woul=
d tell the compiler to specialize the template identically for each type in=
 the typegroup. The example below is a self-explanatory demonstration of th=
e concept:<br>
<br>Example:<br><br>//Proposed introduction of the &quot;typegroup&quot; ke=
yword into the C++ standard<br>//To avoid code duplication in template spec=
ializations<br><br>typegroup floatTypes {double, float, complex};<br>typegr=
oup intTypes {short, int, long long};<br>
<br>//Templated function, but it also could be a method of a templated clas=
s<br>template&lt;typename T&gt; void PrintValue(T value)<br>{<br>=C2=A0=C2=
=A0=C2=A0 //Do something for all types, except specialized one<br>=C2=A0=C2=
=A0=C2=A0 printf(&quot;No specialization for this type.\n&quot;);<br>
}<br><br>//Specialization of the function for all floatTypes<br>template&lt=
;&gt; PrintValue&lt;floatTypes&gt;(floatTypes value)<br>{<br>=C2=A0=C2=A0=
=C2=A0 printf(&quot;%e \n&quot;, value);<br>}<br><br>//Specialization of th=
e function for all intTypes<br>
template&lt;&gt; PrintValue&lt;intTypes&gt;(intTypes value)<br>{<br>=C2=A0=
=C2=A0=C2=A0 printf(&quot;%i \n&quot;, value);<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&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@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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--047d7bf0e02816931104f5c7f899--

.


Author: George Makrydakis <irrequietus@gmail.com>
Date: Sun, 30 Mar 2014 04:32:00 +0300
Raw View
------D1C0U5MR10YDMBX4VW5QVN19XZCJMS
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I think that most code duplication occurs due to less than adequately usabl=
e code generation facilities.

Simply depending on a constraints - driven model (type driven pattern match=
ing through partial specializations, sfinae, soon concepts etc) means that =
for every specific case scenario, there has to be some non - trivial boiler=
plate to be written at times in order to get the necessary code generated. =
Sometimes this even involves using preprocessor metaprogramming techniques =
that may complicate things even further, maintenance - wise.

The most brilliant example of code generation done right in C++11 is what h=
appens when multiple parameter packs are expanded in various combinations i=
nvolving them, for each of which our intent is explicit. Parameter packs ma=
de it possible to implement variadic template behaviour, avoiding underlini=
ng code duplication as was previously done in C++03 libraries implementing =
typelists and other constructs.

Should there be some way of extending such "expansion" mentality into code =
"blocks" (involving more than a single expression / statement) generation t=
erritory in a way that is easily cooperating with the conceptually implicit=
 constraints - driven model we are using for generating code "blocks" right=
 now, code duplication could be effectively minimized.

But this should be an argument for another thread and it is far from being =
an easy subject to tackle in its general case.


Geoffrey Romer <gromer@google.com> wrote:
>Code duplication is just as much of a problem for class templates as
>for
>function templates (and the workarounds are worse), but your proposal
>doesn't seem to do anything for them. It also doesn't help in cases
>where
>you're specializing a non-type template parameter.
>
>I think code duplication in template specializations is a problem well
>worth addressing, but I'd like to see it addressed comprehensively, not
>by
>picking off ad-hoc special cases.
>On Mar 27, 2014 10:11 AM, "Peter Kondratyuk" <pkondratyuk@gmail.com>
>wrote:
>
>> Currently, when specializing templates for multiple types, each type
>has
>> to have its own specialization. This requires code duplication when
>several
>> of these specializations should behave identically.
>>
>> Obviously, duplicated code is bad, so I propose a new keyword,
>> "typegroup", that is only used in template specializations. This
>keyword
>> would tell the compiler to specialize the template identically for
>each
>> type in the typegroup. The example below is a self-explanatory
>> demonstration of the concept:
>>
>> Example:
>>
>> //Proposed introduction of the "typegroup" keyword into the C++
>standard
>> //To avoid code duplication in template specializations
>>
>> typegroup floatTypes {double, float, complex};
>> typegroup intTypes {short, int, long long};
>>
>> //Templated function, but it also could be a method of a templated
>class
>> template<typename T> void PrintValue(T value)
>> {
>>     //Do something for all types, except specialized one
>>     printf("No specialization for this type.\n");
>> }
>>
>> //Specialization of the function for all floatTypes
>> template<> PrintValue<floatTypes>(floatTypes value)
>> {
>>     printf("%e \n", value);
>> }
>>
>> //Specialization of the function for all intTypes
>> template<> PrintValue<intTypes>(intTypes value)
>> {
>>     printf("%i \n", value);
>> }
>>
>> --
>>
>> ---
>> 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/.
>>
>
>--=20
>
>---=20
>You received this message because you are subscribed to the Google
>Groups "ISO C++ Standard - Future Proposals" group.
>To unsubscribe from this group and stop receiving emails from it, send
>an email to std-proposals+unsubscribe@isocpp.org.
>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/.

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

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

<html><head></head><body><p dir=3D"ltr">I think that most code duplication =
occurs due to less than adequately usable code generation facilities.</p>
<p dir=3D"ltr">Simply depending on a constraints - driven model (type drive=
n pattern matching through partial specializations, sfinae, soon concepts e=
tc) means that for every specific case scenario, there has to be some non -=
 trivial boilerplate to be written at times in order to get the necessary c=
ode generated. Sometimes this even involves using preprocessor metaprogramm=
ing techniques that may complicate things even further, maintenance - wise.=
</p>
<p dir=3D"ltr">The most brilliant example of code generation done right in =
C++11 is what happens when multiple parameter packs are expanded in various=
 combinations involving them, for each of which our intent is explicit. Par=
ameter packs made it possible to implement variadic template behaviour, avo=
iding underlining code duplication as was previously done in C++03 librarie=
s implementing typelists and other constructs.</p>
<p dir=3D"ltr">Should there be some way of extending such "expansion" menta=
lity into code "blocks" (involving more than a single expression / statemen=
t) generation territory in a way that is easily cooperating with the concep=
tually implicit constraints - driven model we are using for generating code=
 "blocks" right now, code duplication could be effectively minimized.</p>
<p dir=3D"ltr">But this should be an argument for another thread and it is =
far from being an easy subject to tackle in its general case.<br>
</p>
<br><br><div class=3D"gmail_quote">Geoffrey Romer &lt;gromer@google.com&gt;=
 wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex=
; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<p dir=3D"ltr">Code duplication is just as much of a problem for class temp=
lates as for function templates (and the workarounds are worse), but your p=
roposal doesn&#39;t seem to do anything for them. It also doesn&#39;t help =
in cases where you&#39;re specializing a non-type template parameter.</p>

<p dir=3D"ltr">I think code duplication in template specializations is a pr=
oblem well worth addressing, but I&#39;d like to see it addressed comprehen=
sively, not by picking off ad-hoc special cases.</p>
<div class=3D"gmail_quote">On Mar 27, 2014 10:11 AM, &quot;Peter Kondratyuk=
&quot; &lt;<a href=3D"mailto:pkondratyuk@gmail.com">pkondratyuk@gmail.com</=
a>&gt; wrote:<br type=3D"attribution" /><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir=3D"ltr">Currently, when specializing templates for multiple types,=
 each type has to have its own specialization. This requires code duplicati=
on when several of these specializations should behave identically.<br /><b=
r />
Obviously, duplicated code is bad, so I propose a new keyword, &quot;typegr=
oup&quot;, that is only used in template specializations. This keyword woul=
d tell the compiler to specialize the template identically for each type in=
 the typegroup. The example below is a self-explanatory demonstration of th=
e concept:<br />
<br />Example:<br /><br />//Proposed introduction of the &quot;typegroup&qu=
ot; keyword into the C++ standard<br />//To avoid code duplication in templ=
ate specializations<br /><br />typegroup floatTypes {double, float, complex=
};<br />typegroup intTypes {short, int, long long};<br />
<br />//Templated function, but it also could be a method of a templated cl=
ass<br />template&lt;typename T&gt; void PrintValue(T value)<br />{<br />=
=C2=A0=C2=A0=C2=A0 //Do something for all types, except specialized one<br =
/>=C2=A0=C2=A0=C2=A0 printf(&quot;No specialization for this type.\n&quot;)=
;<br />
}<br /><br />//Specialization of the function for all floatTypes<br />templ=
ate&lt;&gt; PrintValue&lt;floatTypes&gt;(floatTypes value)<br />{<br />=C2=
=A0=C2=A0=C2=A0 printf(&quot;%e \n&quot;, value);<br />}<br /><br />//Speci=
alization of the function for all intTypes<br />
template&lt;&gt; PrintValue&lt;intTypes&gt;(intTypes value)<br />{<br />=C2=
=A0=C2=A0=C2=A0 printf(&quot;%i \n&quot;, value);<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&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@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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br />
</blockquote></div>

<p></p>
</blockquote></div></body></html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------D1C0U5MR10YDMBX4VW5QVN19XZCJMS--


.


Author: Farid Mehrabi <farid.mehrabi@gmail.com>
Date: Wed, 9 Apr 2014 21:18:05 +0430
Raw View
--047d7b5d285889e5af04f69ede8f
Content-Type: text/plain; charset=UTF-8

that reminds me of  'concept' proposal which was intended for c++10 but
later it was dropped from the standard due to its complexity.
I see that you are proposing somewhat a much lighter version. I didn`t
follow the thread to see where it ended; but I think its not too bad to
take a look again.

regards,
FM.


On Thu, Mar 27, 2014 at 9:41 PM, Peter Kondratyuk <pkondratyuk@gmail.com>wrote:

> Currently, when specializing templates for multiple types, each type has
> to have its own specialization. This requires code duplication when several
> of these specializations should behave identically.
>
> Obviously, duplicated code is bad, so I propose a new keyword,
> "typegroup", that is only used in template specializations. This keyword
> would tell the compiler to specialize the template identically for each
> type in the typegroup. The example below is a self-explanatory
> demonstration of the concept:
>
> Example:
>
> //Proposed introduction of the "typegroup" keyword into the C++ standard
> //To avoid code duplication in template specializations
>
> typegroup floatTypes {double, float, complex};
> typegroup intTypes {short, int, long long};
>
> //Templated function, but it also could be a method of a templated class
> template<typename T> void PrintValue(T value)
> {
>     //Do something for all types, except specialized one
>     printf("No specialization for this type.\n");
> }
>
> //Specialization of the function for all floatTypes
> template<> PrintValue<floatTypes>(floatTypes value)
> {
>     printf("%e \n", value);
> }
>
> //Specialization of the function for all intTypes
> template<> PrintValue<intTypes>(intTypes value)
> {
>     printf("%i \n", value);
> }
>
> --
>
> ---
> 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/.
>



--
how am I supposed to end the twisted road of  your hair in the dark night,
unless the candle of your face does not turn a lamp on up my way?

--

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

--047d7b5d285889e5af04f69ede8f
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">that reminds me of =C2=A0&#39;concept&#39; proposal which =
was intended for c++10 but later it was dropped from the standard due to it=
s complexity.<div>I see that you are proposing somewhat a much lighter vers=
ion. I didn`t follow the thread to see where it ended; but I think its not =
too bad to take a look again.</div>

<div><br></div><div>regards,</div><div>FM.</div></div><div class=3D"gmail_e=
xtra"><br><br><div class=3D"gmail_quote">On Thu, Mar 27, 2014 at 9:41 PM, P=
eter Kondratyuk <span dir=3D"ltr">&lt;<a href=3D"mailto:pkondratyuk@gmail.c=
om" target=3D"_blank">pkondratyuk@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Currently, when specializin=
g templates for multiple types, each type has to have its own specializatio=
n. This requires code duplication when several of these specializations sho=
uld behave identically.<br>

<br>Obviously, duplicated code is bad, so I propose a new keyword, &quot;ty=
pegroup&quot;, that is only used in template specializations. This keyword =
would tell the compiler to specialize the template identically for each typ=
e in the typegroup. The example below is a self-explanatory demonstration o=
f the concept:<br>

<br>Example:<br><br>//Proposed introduction of the &quot;typegroup&quot; ke=
yword into the C++ standard<br>//To avoid code duplication in template spec=
ializations<br><br>typegroup floatTypes {double, float, complex};<br>typegr=
oup intTypes {short, int, long long};<br>

<br>//Templated function, but it also could be a method of a templated clas=
s<br>template&lt;typename T&gt; void PrintValue(T value)<br>{<br>=C2=A0=C2=
=A0=C2=A0 //Do something for all types, except specialized one<br>=C2=A0=C2=
=A0=C2=A0 printf(&quot;No specialization for this type.\n&quot;);<br>

}<br><br>//Specialization of the function for all floatTypes<br>template&lt=
;&gt; PrintValue&lt;floatTypes&gt;(floatTypes value)<br>{<br>=C2=A0=C2=A0=
=C2=A0 printf(&quot;%e \n&quot;, value);<br>}<br><br>//Specialization of th=
e function for all intTypes<br>

template&lt;&gt; PrintValue&lt;intTypes&gt;(intTypes value)<br>{<br>=C2=A0=
=C2=A0=C2=A0 printf(&quot;%i \n&quot;, value);<br>}<span class=3D"HOEnZb"><=
font color=3D"#888888"><br></font></span></div><span class=3D"HOEnZb"><font=
 color=3D"#888888">

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</font></span></blockquote></div><br><br clear=3D"all"><div><br></div>-- <b=
r>how am I supposed to end the twisted road of=C2=A0 your hair in the dark =
night,<br>unless the candle of your face does not turn a lamp on up my way?=
<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&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--047d7b5d285889e5af04f69ede8f--

.