Topic: Multiple (partial)specialization


Author: Dejan Milosavljevic <dmilos@gmail.com>
Date: Tue, 20 Mar 2018 02:20:40 -0700 (PDT)
Raw View
------=_Part_14793_1728773271.1521537640036
Content-Type: multipart/alternative;
 boundary="----=_Part_14794_962361302.1521537640037"

------=_Part_14794_962361302.1521537640037
Content-Type: text/plain; charset="UTF-8"

Hello

  Here is simple idea how to use existing code to make several (partial)
specialization at once.
  Instead of one type use list of types.

  Quick example:

template< typename T > //Primary template as we know
  class A {
     void print(){ std::cout << "Primary template" << std::endl; }
   };
template<>
  class A< { char*, std::string, std::wstring } > { // Instead one type it
is list of types.
     void print(){ std::cout << "String  specialization" << std::endl; }
   };


More details/examples in attachment.
Source controlled
file: https://github.com/dmilos/cpp_proposal/blob/master/multi_spec.html

D.


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

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

<div dir=3D"ltr"><div>Hello</div><div><br></div><div>=C2=A0 Here is simple =
idea how to use existing code to make several (partial) specialization at o=
nce.</div><div>=C2=A0 Instead of one type use list of types.</div><div><br>=
</div><div>=C2=A0 Quick example:</div><blockquote style=3D"margin-right: 0p=
x;" dir=3D"ltr"><div><font face=3D"courier new,monospace">template&lt; type=
name T &gt; //Primary template as we know<br>=C2=A0 class A {<br>=C2=A0=C2=
=A0=C2=A0=C2=A0 void print(){ std::cout &lt;&lt; &quot;Primary template&quo=
t; &lt;&lt; std::endl; }<br>=C2=A0=C2=A0 };</font></div><div><font face=3D"=
courier new,monospace">template&lt;&gt;<br>=C2=A0 class A&lt; { char*, std:=
:string, std::wstring } &gt; { // Instead one type it is list of types.<br>=
=C2=A0=C2=A0=C2=A0=C2=A0 void print(){ std::cout &lt;&lt; &quot;String=C2=
=A0 specialization&quot; &lt;&lt; std::endl; }<br>=C2=A0=C2=A0 };</font></d=
iv><div><b><font face=3D"courier new,monospace"><br></font></b></div></bloc=
kquote><div><br></div><div>More details/examples in attachment.</div><div>S=
ource controlled file:=C2=A0https://github.com/dmilos/cpp_proposal/blob/mas=
ter/multi_spec.html</div><div><br></div><div>D.</div><div>=C2=A0</div></div=
>

<p></p>

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

------=_Part_14794_962361302.1521537640037--

------=_Part_14793_1728773271.1521537640036
Content-Type: text/html; charset=US-ASCII; name=multi_spec.html
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=multi_spec.html
X-Attachment-Id: 1cc3d6e7-fa9d-46a8-a5d0-c35662b9e778
Content-ID: <1cc3d6e7-fa9d-46a8-a5d0-c35662b9e778>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>[C++]Multiple (partial)specialization.</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta name="Author"             content="Dejan D. M. R. Milosavljevic" />
  <meta name="Reply-to"           content="office@ddmrm.com" />
  <meta name="resource-type"      content="document" />
  <meta name="URL"                content="http://www.ddmrm.com" />
  <meta name="revisit-after"      content="45 days" />
  <meta name="Keywords"           content="c++ proposal" />

  <style type="text/css">
<!--

body {
    margin-top: 20mm;
    margin-right: 18mm;
    margin-bottom: 20mm;
    margin-left: 18mm;
    border-width: 0;
    padding-top: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
    margin: 0;
    vertical-align: baseline;
    font-size:16px;
}

table {
     vertical-align: baseline;
}
..paragraf {
    text-indent: 10pt;
}

..IndentedBlock3ex {
    margin-left: 3ex;
}

..IndentedBlock2ex {
    margin-left: 2ex;
}

..IndentedBlock1ex {
    margin-left: 1ex;
}
..NovaStranica {
    page-break-before: auto;
    page-break-after: always;
}

..NaslovStranice
{
 font-size:30px;
 font-weight:bold;
}

..NaslovGlavni
{
 font-size:28px;
 font-weight:bold;
}

..NaslovPod
 {
  font-size: 22px;
  font-weight:bold;
 }

..Naslovcic
 {
  font-size: 18px;
  font-weight:bold;
 }

..NaslovcicJosManji
 {
  font-size: 16px;
  font-weight:bold;
 }

..TextObican
 {
    font-size: 15px;
 }
..TOCItem
{
 font-size:18px;
 font-weight:bold;
}


..NaslovDefinicije
{
    font-size: 10;
}

..TextCode
 {
    font-size: 12px;
 }

-->
  </style>
 </head>

 <body bgcolor="#FFFFFF" text="#000000" class="TextObican">
  <h1 align="center" > <div class="NaslovStranice">Multiple (partial)specialization</div> </h1>
   <table border="0" width="100%">
    <tr>
     <td width="100%">&nbsp;</td>
     <td nowrap="nowrap">
      Document number: <br>
      Date: <br>
      Reply to:<br>
      <br>
     </td>
     <td nowrap="nowrap">
      <br>
      2018/02/12<br>
      Dejan D.M. Milosavljevic<br>
      (dmilos at gmail dot com)<br>
     </td>
     <td width="10%">&nbsp;</td>
    </tr>
   </table>
   <dl>
    <dt><div class="NaslovGlavni">Table of Contents.</div></dt>
    <dd>
     <ul>
      <li><div class="TOCItem">I. Introduction</div></li>
      <li><div class="TOCItem">II. Motivation and Scope</div></li>
      <li><div class="TOCItem">III. Solutions</div></li>
      <li><div class="TOCItem">IV. Design Decisions</div></li>
      <li><div class="TOCItem">V. Impact On the Standard</div></li>
      <li><div class="TOCItem">VI. References</div></li>
     </ul>
    </dd>

   <dt><div class="NaslovGlavni">I. Introduction</div></dt>
   <dd>
     Multiple (partial)specialization.
     This feature will allow multiple (partial)specialize of template without need for additional code.
     It is assumed that extra/additional code is something that comes after class definition or (partial) specialization.<br><br>
   </dd>
   <dt><div class="NaslovGlavni">II. Motivation and Scope</div></dt>

      <dd>
   Usual problem with template specialization is how to reuse existing code for other type.
   One of idea is to have separate code for each type that will point to previous specialization. But this idea will rise more requests such as modification of existing functions and members.
   This idea avoid those request by use of existing code at point of (partial)specialization.<br><br>

   It is often that some types can be grouped in manner that share same class specialization.
   In presented example we have integer group( short, int, long ), rational ( float, double, long double ) and strng ( char*, std::string, std::wstring ).
    <dl>
     <dt class="Naslovcic">Problem 1:</dt>
     <dd>
       Lets make several groups of types. Each group heed their own specialization.<br>
       In next example we have two groups.<br>
       First group contain: <code>char*</code>,  <code>std::string</code>, <code>std::wstring</code>. Second group: <code>float</code>, <code>double</code>, <code>long double</code>.<br>

       Note: This example can be extended with more groups like signed integers, unsigned integers.<br><br>

<br>[<i>Example</i>:<code><blockquote><pre class="TextCode">
template&lt; typename T &gt;
 class A {
   void print(){ std::cout &lt;&lt; "Primary template" &lt;&lt; std::endl; }
  };

template&lt;&gt;
 class A&lt; std::string &gt; {
   void print(){ std::cout &lt;&lt; "String  specialization" &lt;&lt; std::endl; }
  };
template&lt;&gt;
 class A&lt; char* &gt; { // NOTE: In here we keep "String specialization".
   void print(){ std::cout &lt;&lt; "String  specialization" &lt;&lt; std::endl; }
  };

template&lt;&gt;
 class A&lt; std::wstring &gt; { // NOTE: In here we keep "String specialization".
   void print(){ std::cout &lt;&lt; "String  specialization" &lt;&lt; std::endl; }
  };

template&lt;&gt;
 class A&lt;float &gt; {
   void print(){ std::cout &lt;&lt; "Rational specialization" &lt;&lt; std::endl; }
  };
template&lt;&gt;
 class A&lt; double &gt; { // NOTE: Same as <b>foat</b>
   void print(){ std::cout &lt;&lt; "Rational  specialization" &lt;&lt; std::endl; }
  };

template&lt;&gt;
 class A&lt; long double &gt; { // NOTE: Same as <b>foat</b>
   void print(){ std::cout &lt;&lt; "Rational  specialization" &lt;&lt; std::endl; }
  };
</pre></blockquote></code>&mdash;<i>end example</i>]
    </dd>
    <dt class="Naslovcic">Problem 2:</dt>
    <dd>
      Lest start with some enum with enough large number of enumerants.<br>
      Goal is to specialize <code>class E</code> so the enum subgroups have same template specialization.<br>
      In this example first subgroup are consisted from <code>red</code>, <code>green</code>, <code>blue</code>. <br>
      Second subgroup: <code>cyan</code>, <code>yellow</code> and <code>magenta</code>.<br><br>
    <br>[<i>Example</i>:<code><blockquote><pre class="TextCode">

enum colors{ red, green, blue, cyan, magenta, yellow, orange, pink };

template&lt; enum Colors color = red &gt;
 class E {
    void print(){ std::cout &lt;&lt; "Primary template with red default"&lt;&lt; std::endl;  }
  };

template&lt; &gt;
 class E&lt; green &gt; { // In here we want to keep primary definition of <i>print</i> function
    void print(){ std::cout &lt;&lt; "Primary template with red default"&lt;&lt; std::endl;  }
  };

template&lt; &gt;
 class E&lt; blue &gt; { // In here we want to keep primary definition of <i>print</i> function
    void print(){ std::cout &lt;&lt; "Primary template with red default"&lt;&lt; std::endl;  }
  };

template&lt; &gt;
 class E&lt; yellow &gt; { // Brand new specialization of <i>print</i> function
    void print(){ std::cout &lt;&lt; "YELLOW"&lt;&lt; std::endl;  }
  };

template&lt; &gt;
 class E&lt; magenta &gt; { // Same as E&lt; yellow &gt;
    void print(){ std::cout &lt;&lt; "YELLOW"&lt;&lt; std::endl;  }
  };

  // etc
</pre></blockquote></code>&mdash;<i>end example</i>]

    </dd>

    <dt class="Naslovcic">Problem 3:</dt>
      <dd>
         Similarly like for enums, in here some groups of integers need to share same specialization.
         Specialize for specific integer values.<br>


         <br>[<i>Example</i>:<code><blockquote><pre class="TextCode">

template&lt; unsigned number&gt;
 class I {
    void print(){ std::cout &lt;&lt; "Primary template." &lt;&lt; std::endl; }
  };

template&lt; &gt;
 class I&lt; 0 &gt; {
    void print(){ std::cout &lt;&lt; " up to 10 and 10 ." &lt;&lt; std::endl; }
  };
 /* In here repeat above code with numbers between 1 and 10*/
template&lt; &gt;
 class I&lt; 10 &gt; {
    void print(){ std::cout &lt;&lt; " up to 10 and 10." &lt;&lt; std::endl; }
  };

template&lt; &gt;
 class I&lt; 11 &gt; {
    void print(){ std::cout &lt;&lt; " up to 100 and 100." &lt;&lt; std::endl; }
  };
 /* repeat above code with numbers between 11 and 100*/
template&lt; &gt;  class I&lt; 100 &gt;
  {
    void print(){ std::cout &lt;&lt; " up to 100 and 100." &lt;&lt; std::endl; }
  };
</pre></blockquote></code>&mdash;<i>end example</i>]
      </dd>
   </dl>
    <br><br>
  <p class="NovaStranica"></p>
  </dd>
  <dt><div class="NaslovGlavni">III. Solutions</div></dt>
<dd>
  <dl>
   <dt class="Naslovcic">Solutions within current standard </dt>
   <dd>
    <dl>
      <dt class="NaslovcicJosManji">Using copy/paste</dt>
      <dd>
       Already demonstrated in above examples. Lacks are obvious and well known.
      </dd>
      <dt class="NaslovcicJosManji"> By using macro replacement ( <code>#define</code> ).</dt>
      <dd>
<br>[<i>Example</i>:<code><blockquote><pre class="TextCode">
template&lt; typename T &gt;
 class A {
   void print(){ std::cout &lt;&lt; "Primary template" &lt;&lt; std::endl; }
  };

#define A_for_string(string_like_type)    \
    template&lt; &gt;    \
     class A&lt; string_like_type T &gt; {    \
       void print(){ std::cout &lt;&lt; "String template" &lt;&lt; std::endl; }    \
      }

A_for_string( char* );
A_for_string( std::string );
A_for_string( std::wsring );
</pre></blockquote></code>&mdash;<i>end example</i>]

Replacing template with <code>#define</code> is bad idea.
And again lacks are obvious and well known.

      </dd>
      <dt class="NaslovcicJosManji">Involving the inheritance</dt>
      <dd>
<br>[<i>Example</i>:<code><blockquote><pre class="TextCode">
template&lt; typename T &gt;
 class A {
   void print(){ std::cout &lt;&lt; "Primary template" &lt;&lt; std::endl; }
  };

template&lt; typename string_like_type &gt;
 class A_string {
   void print(){ std::cout &lt;&lt; "String template" &lt;&lt; std::endl; }
  }

template&lt;&gt;
 class A&lt; std::string &gt;
  : public A_string&lt; std::string &gt; {
   // nothing
  };

template&lt;&gt;
 class A&lt; std::wstring &gt;
  : public A_string&lt; std::wstring &gt; {
   // nothing
  };
</pre></blockquote></code>&mdash;<i>end example</i>]
      <br>In this case there is additional class that need to bi hidden from user. This can be consider as code bloat.

      </dd>
    </dl>
   </dd>

   <dt  class="Naslovcic" >Proposal</dt>
    <dd>
      Use list of types in place on one type. Type list should be enclosed with '{' and '}'.<br>
      All examples can be easily extended in partial specialization examples.
     <dl>
       <dt>float, string, ints:</dt>
       <dd>
        Generalized primary template. Several specialized templates at once with list of types

<br>[<i>Example</i>:<code><blockquote><pre class="TextCode">
template&lt; typename T &gt; // Primary template. As per standard
 class A {
   void print(){ std::cout &lt;&lt; "Primary template" &lt;&lt; std::endl; }
  };

template&lt;&gt;
 class A&lt; <b>{ char*, std::string, std::wstring }</b> &gt; { // Instead one type it is list of types.
   void print(){ std::cout &lt;&lt; "String  specialization" &lt;&lt; std::endl; }
  };

template&lt;&gt;
 class A&lt; <b>{ float, double, long double }</b> &gt; {
   void print(){ std::cout &lt;&lt; "Rational specialization" &lt;&lt; std::endl; }
  };

template&lt; typename T &gt;
 class A&lt; std::vector &lt <b>{ T, short, int, long }</b> &gt; &gt; { // Partial and and full specialization at once.
   void print(){ std::cout &lt;&lt; "std::vector &lt; Integers &gt;" &lt;&lt; std::endl; }
  };
</pre></blockquote></code>&mdash;<i>end example</i>]
</dd>


<dt>enums:</dt>
<dd>
 Primary template with default parameter and two more types ( actually enums ).<br>
 Enums must appear in ascending order.

<br>[<i>Example</i>:<code><blockquote><pre class="TextCode">
enum colors{ red, green, blue, cyan, yellow, magenta, orange, pink };

// red is default, Other enums in list must appear in order of appearance in their definition.
template&lt; enum Colors color = red <b>{ red, ... , blue }</b> &gt;
 class E {
    void print(){ std::cout &lt;&lt; "Primary template with red default"&lt;&lt; std::endl;  }
  };

template&lt; &gt;
 class E&lt; <b>{ cyan, ... , yellow }</b> &gt; { // Take all enums between cyan and key
  // Brand new specialization of <i>print</i> function
    void print(){ std::cout &lt;&lt; "YELLOW"&lt;&lt; std::endl;  }
  };
</pre></blockquote></code>&mdash;<i>end example</i>]
</dd>

<dt>Integer:</dt>
<dd>
 Demonstration of massive specialization on very small space. <br>
 Only integral types can use ellipsis.<br>
 Numbers must appear in ascending order.

<br>[<i>Example</i>:<code><blockquote><pre class="TextCode">
template&lt; unsigned number = 0 &gt;
 class I {
    void print(){ std::cout &lt;&lt; "Primary template." &lt;&lt; std::endl; }
  };

template&lt; &gt;
 class I&lt; <b>{ 1, ..., 10 }</b> &gt;{ // Numbers must appear in increasing order
    void print(){ std::cout &lt;&lt; " up to 10 and 10 ." &lt;&lt; std::endl; }
  };

template&lt; &gt;
 class I&lt; <b>{ 11, ..., 100 }</b> &gt; {
    void print(){ std::cout &lt;&lt; " from 11 to 100 and 100." &lt;&lt; std::endl; }
  };

template&lt; &gt;
 class I&lt; 42 &gt;{ // ERROR: Already specialized.
  {
    void print(){ std::cout &lt;&lt; " 42." &lt;&lt; std::endl; }
  };
</pre></blockquote></code>&mdash;<i>end example</i>]
</dd>

<dt> Multi specialization on two ( or more ) parameters:</dt>
<dd>

When two or more parameters are list of types ( or integers ) all pairs ( tuples ) will be specialized.

<br>[<i>Example</i>:<code><blockquote><pre class="TextCode">
template&lt; typename S, typename T &gt;
 class D {
    void print(){ std::cout &lt;&lt; "Primary template." &lt;&lt; std::endl; }
  };

template&lt; &gt;
 class D&lt; <b>{ int, long }, { std::string, std::wstring }</b> &gt;{
    void print(){ std::cout &lt;&lt; "{ int, long }, { std::string, std::wstring }" &lt;&lt; std::endl; }
  };

template&lt; &gt;
 class D&lt; <b>int, std::wstring </b>&gt;{ // ERROR: Specialization already exists
    void print(){ std::cout &lt;&lt; " int, std::wstring " &lt;&lt; std::endl; }
  };
</pre></blockquote></code>&mdash;<i>end example</i>]
<br><br>
It is not possible to have some exception for some pair ( tuples ) of types.
<br>[<i>Example</i>:<code><blockquote><pre class="TextCode">
template&lt; typename S, typename T &gt;
 class E {
    void print(){ std::cout &lt;&lt; "Primary template." &lt;&lt; std::endl; }
  };

template&lt; &gt;
 class E&lt; <b>int, std::wstring </b>&gt;{ // OK. Specialization for int and std::wstring
    void print(){ std::cout &lt;&lt; " int, std::wstring " &lt;&lt; std::endl; }
  };

template&lt; &gt;
 class E&lt; <b>{ int, long }, { std::string, std::wstring }</b> &gt;{ // ERROR: One pair is already specialized.
    void print(){ std::cout &lt;&lt; "{ int, long }, { std::string, std::wstring }" &lt;&lt; std::endl; }
  };

</pre></blockquote></code>&mdash;<i>end example</i>]

</dd>
    </dl>
   </dd>
  </dl>
 <p class="NovaStranica"></p>
 </dd>
   <dt><div class="NaslovGlavni">IV. Design Decisions</div></dt>
   <dd>
      <ul>
       <li>Massive (partial)specialization at the cost of one definition.</li>
       <li>Due to fact the that same code are shared with other types it is not possible make different implementation mistakenly for some type of same group.</li>
       <li>There is no need for additional code like in N3596 or similar solution. Which is one of the main goal i.e no additional code. One place and start place only.</li>
       <li>Do not solve (and not intention): Reuse of existing (partial)specialization by modification, function/member excluding/adding/redefining.
       </li>
   </ul>
    <dl>
    </dl>
   </dd>

   <dt><div class="NaslovGlavni">V. Impact On the Standard</div></dt>
   <dd>
     <dl>
       <dt> <div class="NaslovPod ">Core</div> </dt>
       <dd>No effect.<br>
           No new keywords. <br>
           No new tokens. <br>
           No changes to old syntax. <br>
           Pure extension. <br>
           Backward compatible.
       </dd>
       <dt><div class="NaslovPod ">Library</div></dt>
       <dd>No effect.<br> No new class.<br> No new functions. </dd>
       <dt><div class="NaslovPod ">Existing code.</div></dt>
       <dd>No effect.<br>
     </dl>
   </dd>
  </dl>
  <hr shade width="100%" align="center">
 </body>
</html>







------=_Part_14793_1728773271.1521537640036--

.


Author: Barry Revzin <barry.revzin@gmail.com>
Date: Tue, 20 Mar 2018 03:52:06 -0700 (PDT)
Raw View
------=_Part_15172_1359998790.1521543126449
Content-Type: multipart/alternative;
 boundary="----=_Part_15173_1524524741.1521543126450"

------=_Part_15173_1524524741.1521543126450
Content-Type: text/plain; charset="UTF-8"



On Tuesday, March 20, 2018 at 9:20:40 AM UTC, Dejan Milosavljevic wrote:
>
> Hello
>
>   Here is simple idea how to use existing code to make several (partial)
> specialization at once.
>


These are explicit specializations.



>   Instead of one type use list of types.
>
>   Quick example:
>
> template< typename T > //Primary template as we know
>   class A {
>      void print(){ std::cout << "Primary template" << std::endl; }
>    };
> template<>
>   class A< { char*, std::string, std::wstring } > { // Instead one type it
> is list of types.
>      void print(){ std::cout << "String  specialization" << std::endl; }
>    };
>
>
> More details/examples in attachment.
> Source controlled file:
> https://github.com/dmilos/cpp_proposal/blob/master/multi_spec.html
>
> D.
>
>

What do you think instead of a syntax which allows you to make a partial
class template specialization based on constraining the template parameter?

template <typename T>
class A { ... };

template <typename T, typename... Us>
inline constexpr bool is_any_of_v = (std::is_same_v<T, Us> || ... );

template <typename T>
    requires is_any_of_v<T, char*, std::string, std::wstring>
class A<T> { ... };

 Or even:

template <typename T>
concept StringLike = /* something sane */;

template <StringLike T>
class A<T> { ... };

This language feature is called Concepts, and is already in the working
draft for C++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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/90cc934f-8532-4110-8d73-2824dabd51ec%40isocpp.org.

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

<div dir=3D"ltr"><br><br>On Tuesday, March 20, 2018 at 9:20:40 AM UTC, Deja=
n Milosavljevic 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"><div>Hello</div><div><br></div><div>=C2=A0 Here is simple idea how=
 to use existing code to make several (partial) specialization at once.</di=
v></div></blockquote><div>=C2=A0</div><div><br></div><div>These are explici=
t specializations.</div><div><br></div><div>=C2=A0</div><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"><div>=C2=A0 Instead of one typ=
e use list of types.</div><div><br></div><div>=C2=A0 Quick example:</div><b=
lockquote style=3D"margin-right:0px" dir=3D"ltr"><div><font face=3D"courier=
 new,monospace">template&lt; typename T &gt; //Primary template as we know<=
br>=C2=A0 class A {<br>=C2=A0=C2=A0=C2=A0=C2=A0 void print(){ std::cout &lt=
;&lt; &quot;Primary template&quot; &lt;&lt; std::endl; }<br>=C2=A0=C2=A0 };=
</font></div><div><font face=3D"courier new,monospace">template&lt;&gt;<br>=
=C2=A0 class A&lt; { char*, std::string, std::wstring } &gt; { // Instead o=
ne type it is list of types.<br>=C2=A0=C2=A0=C2=A0=C2=A0 void print(){ std:=
:cout &lt;&lt; &quot;String=C2=A0 specialization&quot; &lt;&lt; std::endl; =
}<br>=C2=A0=C2=A0 };</font></div><div><b><font face=3D"courier new,monospac=
e"><br></font></b></div></blockquote><div><br></div><div>More details/examp=
les in attachment.</div><div>Source controlled file:=C2=A0<a href=3D"https:=
//github.com/dmilos/cpp_proposal/blob/master/multi_spec.html" target=3D"_bl=
ank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://www.google.co=
m/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdmilos%2Fcpp_proposal%2Fblob%2Fmaster=
%2Fmulti_spec.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG9_Z9J4X6PjECVGd=
Ic2SWZ_DZ-jQ&#39;;return true;" onclick=3D"this.href=3D&#39;https://www.goo=
gle.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fdmilos%2Fcpp_proposal%2Fblob%2F=
master%2Fmulti_spec.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG9_Z9J4X6P=
jECVGdIc2SWZ_DZ-jQ&#39;;return true;">https://github.com/<wbr>dmilos/cpp_pr=
oposal/blob/<wbr>master/multi_spec.html</a></div><div><br></div><div>D.</di=
v><div>=C2=A0</div></div></blockquote><div><br></div><div>What do you think=
 instead of a syntax which allows you to make a partial class template spec=
ialization based on constraining the template parameter?=C2=A0</div><div><b=
r></div><div><div class=3D"prettyprint" style=3D"background-color: rgb(250,=
 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-w=
idth: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div class=
=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">template</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</sp=
an><span style=3D"color: #008;" class=3D"styled-by-prettify">typename</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> T</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">class</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> A </span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">...</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">};</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></spa=
n><span style=3D"color: #008;" class=3D"styled-by-prettify">template</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><font color=3D"=
#000088"><span style=3D"color: #008;" class=3D"styled-by-prettify">typename=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> T</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">typename</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">...</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D=
"styled-by-prettify">Us</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"><br></span></font><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">inline</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">const=
expr</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #008;" class=3D"styled-by-prettify">bool</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> is_any_of_v </span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">std</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify">is_same_v</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">T</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span>=
<span style=3D"color: #606;" class=3D"styled-by-prettify">Us</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">||</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">..</span><font color=3D"#000000"><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">.</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">);</span></font><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br><br></span><span style=3D"color: #008;" class=3D"styled-=
by-prettify">template</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-prettify">type=
name</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> T</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 re=
quires is_any_of_v</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">T</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #008;" class=3D"styled-by-prettify">char</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">*,</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> std</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">::</span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">string</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> std</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">wst=
ring</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><=
span style=3D"color: #008;" class=3D"styled-by-prettify">class</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> A</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">T</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">...=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">};</span></div></co=
de></div><br>=C2=A0Or even:</div><div><br></div><div><div class=3D"prettypr=
int" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, =
187, 187); border-style: solid; border-width: 1px; word-wrap: break-word;">=
<code class=3D"prettyprint"><div class=3D"subprettyprint"><font color=3D"#6=
60066"><span style=3D"color: #008;" class=3D"styled-by-prettify">template</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">typename</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> T</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">concept</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"style=
d-by-prettify">StringLike</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #800;" class=3D"styled-by-prettify">/* somethi=
ng sane */</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br><=
/span><span style=3D"color: #008;" class=3D"styled-by-prettify">template</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=
=3D"color: #606;" class=3D"styled-by-prettify">StringLike</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> T</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">class</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> A</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">T</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">...</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">};</span></font></div></code></div><div><br></di=
v>This language feature is called Concepts, and is already in the working d=
raft for C++20.</div><div><br></div></div>

<p></p>

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

------=_Part_15173_1524524741.1521543126450--

------=_Part_15172_1359998790.1521543126449--

.


Author: Dejan Milosavljevic <dmilos@gmail.com>
Date: Tue, 20 Mar 2018 12:06:38 +0100
Raw View
--001a1141fd2698f3680567d61114
Content-Type: text/plain; charset="UTF-8"

> This language feature is called Concepts, and is already in the working
draft for C++20

Concept allows you to make constraints on not (yet) exiting types.
This make specialization on existing types.



On Tue, Mar 20, 2018 at 11:52 AM, Barry Revzin <barry.revzin@gmail.com>
wrote:

>
>
> On Tuesday, March 20, 2018 at 9:20:40 AM UTC, Dejan Milosavljevic wrote:
>>
>> Hello
>>
>>   Here is simple idea how to use existing code to make several (partial)
>> specialization at once.
>>
>
>
> These are explicit specializations.
>
>
>
>>   Instead of one type use list of types.
>>
>>   Quick example:
>>
>> template< typename T > //Primary template as we know
>>   class A {
>>      void print(){ std::cout << "Primary template" << std::endl; }
>>    };
>> template<>
>>   class A< { char*, std::string, std::wstring } > { // Instead one type
>> it is list of types.
>>      void print(){ std::cout << "String  specialization" << std::endl; }
>>    };
>>
>>
>> More details/examples in attachment.
>> Source controlled file: https://github.com/dmilo
>> s/cpp_proposal/blob/master/multi_spec.html
>>
>> D.
>>
>>
>
> What do you think instead of a syntax which allows you to make a partial
> class template specialization based on constraining the template parameter?
>
> template <typename T>
> class A { ... };
>
> template <typename T, typename... Us>
> inline constexpr bool is_any_of_v = (std::is_same_v<T, Us> || ... );
>
> template <typename T>
>     requires is_any_of_v<T, char*, std::string, std::wstring>
> class A<T> { ... };
>
>  Or even:
>
> template <typename T>
> concept StringLike = /* something sane */;
>
> template <StringLike T>
> class A<T> { ... };
>
> This language feature is called Concepts, and is already in the working
> draft for C++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.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/90cc934f-8532-4110-
> 8d73-2824dabd51ec%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/90cc934f-8532-4110-8d73-2824dabd51ec%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>

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

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

<div dir=3D"ltr"><div><span style=3D"text-align:left;color:rgb(34,34,34);te=
xt-transform:none;text-indent:0px;letter-spacing:normal;font-family:arial,s=
ans-serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weigh=
t:400;text-decoration:none;word-spacing:0px;display:inline;white-space:norm=
al;direction:ltr;float:none;background-color:transparent">&gt; This languag=
e feature is called Concepts, and is already in the working draft for C++20=
</span></div><div><span style=3D"text-align:left;color:rgb(34,34,34);text-t=
ransform:none;text-indent:0px;letter-spacing:normal;font-family:arial,sans-=
serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:40=
0;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;d=
irection:ltr;float:none;background-color:transparent"><br></span></div><div=
><span style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;tex=
t-indent:0px;letter-spacing:normal;font-family:arial,sans-serif;font-size:1=
2.8px;font-style:normal;font-variant:normal;font-weight:400;text-decoration=
:none;word-spacing:0px;display:inline;white-space:normal;direction:ltr;floa=
t:none;background-color:transparent">Concept allows you to make constraints=
 on not (yet) exiting types.</span></div><div><span style=3D"text-align:lef=
t;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:no=
rmal;font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-v=
ariant:normal;font-weight:400;text-decoration:none;word-spacing:0px;display=
:inline;white-space:normal;direction:ltr;float:none;background-color:transp=
arent">This make specialization on existing types.</span><span style=3D"tex=
t-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter=
-spacing:normal;font-family:arial,sans-serif;font-size:12.8px;font-style:no=
rmal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:=
0px;display:inline;white-space:normal;direction:ltr;float:none;background-c=
olor:transparent"></span></div><div><span style=3D"text-align:left;color:rg=
b(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-=
family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant:nor=
mal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline;wh=
ite-space:normal;direction:ltr;float:none;background-color:transparent"><br=
></span></div><div><span style=3D"text-align:left;color:rgb(34,34,34);text-=
transform:none;text-indent:0px;letter-spacing:normal;font-family:arial,sans=
-serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:4=
00;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;=
direction:ltr;float:none;background-color:transparent"><br></span></div></d=
iv><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Tue, Mar 20=
, 2018 at 11:52 AM, Barry Revzin <span dir=3D"ltr">&lt;<a href=3D"mailto:ba=
rry.revzin@gmail.com" target=3D"_blank">barry.revzin@gmail.com</a>&gt;</spa=
n> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><span><br><br>=
On Tuesday, March 20, 2018 at 9:20:40 AM UTC, Dejan Milosavljevic wrote:<bl=
ockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>Hello</div><div>=
<br></div><div>=C2=A0 Here is simple idea how to use existing code to make =
several (partial) specialization at once.</div></div></blockquote><div>=C2=
=A0</div><div><br></div></span><div>These are explicit specializations.</di=
v><span><div><br></div><div>=C2=A0</div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:=
1ex"><div dir=3D"ltr"><div>=C2=A0 Instead of one type use list of types.</d=
iv><div><br></div><div>=C2=A0 Quick example:</div><blockquote style=3D"marg=
in-right:0px" dir=3D"ltr"><div><font face=3D"courier new,monospace">templat=
e&lt; typename T &gt; //Primary template as we know<br>=C2=A0 class A {<br>=
=C2=A0=C2=A0=C2=A0=C2=A0 void print(){ std::cout &lt;&lt; &quot;Primary tem=
plate&quot; &lt;&lt; std::endl; }<br>=C2=A0=C2=A0 };</font></div><div><font=
 face=3D"courier new,monospace">template&lt;&gt;<br>=C2=A0 class A&lt; { ch=
ar*, std::string, std::wstring } &gt; { // Instead one type it is list of t=
ypes.<br>=C2=A0=C2=A0=C2=A0=C2=A0 void print(){ std::cout &lt;&lt; &quot;St=
ring=C2=A0 specialization&quot; &lt;&lt; std::endl; }<br>=C2=A0=C2=A0 };</f=
ont></div><div><b><font face=3D"courier new,monospace"><br></font></b></div=
></blockquote><div><br></div><div>More details/examples in attachment.</div=
><div>Source controlled file:=C2=A0<a href=3D"https://github.com/dmilos/cpp=
_proposal/blob/master/multi_spec.html" target=3D"_blank" rel=3D"nofollow">h=
ttps://github.com/dmilo<wbr>s/cpp_proposal/blob/master/<wbr>multi_spec.html=
</a></div><div><br></div><div>D.</div><div>=C2=A0</div></div></blockquote><=
div><br></div></span><div>What do you think instead of a syntax which allow=
s you to make a partial class template specialization based on constraining=
 the template parameter?=C2=A0</div><div><br></div><div><div class=3D"m_485=
155225628945315prettyprint" style=3D"background-color:rgb(250,250,250);bord=
er-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:bre=
ak-word"><code class=3D"m_485155225628945315prettyprint"><div class=3D"m_48=
5155225628945315subprettyprint"><span class=3D"m_485155225628945315styled-b=
y-prettify" style=3D"color:#008">template</span><span class=3D"m_4851552256=
28945315styled-by-prettify" style=3D"color:#000"> </span><span class=3D"m_4=
85155225628945315styled-by-prettify" style=3D"color:#660">&lt;</span><span =
class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#008">typen=
ame</span><span class=3D"m_485155225628945315styled-by-prettify" style=3D"c=
olor:#000"> T</span><span class=3D"m_485155225628945315styled-by-prettify" =
style=3D"color:#660">&gt;</span><span class=3D"m_485155225628945315styled-b=
y-prettify" style=3D"color:#000"><br></span><span class=3D"m_48515522562894=
5315styled-by-prettify" style=3D"color:#008">class</span><span class=3D"m_4=
85155225628945315styled-by-prettify" style=3D"color:#000"> A </span><span c=
lass=3D"m_485155225628945315styled-by-prettify" style=3D"color:#660">{</spa=
n><span class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#00=
0"> </span><span class=3D"m_485155225628945315styled-by-prettify" style=3D"=
color:#660">...</span><span class=3D"m_485155225628945315styled-by-prettify=
" style=3D"color:#000"> </span><span class=3D"m_485155225628945315styled-by=
-prettify" style=3D"color:#660">};</span><span class=3D"m_48515522562894531=
5styled-by-prettify" style=3D"color:#000"><br><br></span><span class=3D"m_4=
85155225628945315styled-by-prettify" style=3D"color:#008">template</span><s=
pan class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#000"> =
</span><span class=3D"m_485155225628945315styled-by-prettify" style=3D"colo=
r:#660">&lt;</span><font color=3D"#000088"><span class=3D"m_485155225628945=
315styled-by-prettify" style=3D"color:#008">typename</span><span class=3D"m=
_485155225628945315styled-by-prettify" style=3D"color:#000"> T</span><span =
class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#660">,</sp=
an><span class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#0=
00"> </span><span class=3D"m_485155225628945315styled-by-prettify" style=3D=
"color:#008">typename</span><span class=3D"m_485155225628945315styled-by-pr=
ettify" style=3D"color:#660">...</span><span class=3D"m_485155225628945315s=
tyled-by-prettify" style=3D"color:#000"> </span><span class=3D"m_4851552256=
28945315styled-by-prettify" style=3D"color:#606">Us</span><span class=3D"m_=
485155225628945315styled-by-prettify" style=3D"color:#660">&gt;</span><span=
 class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#000"><br>=
</span></font><span class=3D"m_485155225628945315styled-by-prettify" style=
=3D"color:#008">inline</span><span class=3D"m_485155225628945315styled-by-p=
rettify" style=3D"color:#000"> </span><span class=3D"m_485155225628945315st=
yled-by-prettify" style=3D"color:#008">constexpr</span><span class=3D"m_485=
155225628945315styled-by-prettify" style=3D"color:#000"> </span><span class=
=3D"m_485155225628945315styled-by-prettify" style=3D"color:#008">bool</span=
><span class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#000=
"> is_any_of_v </span><span class=3D"m_485155225628945315styled-by-prettify=
" style=3D"color:#660">=3D</span><span class=3D"m_485155225628945315styled-=
by-prettify" style=3D"color:#000"> </span><span class=3D"m_4851552256289453=
15styled-by-prettify" style=3D"color:#660">(</span><span class=3D"m_4851552=
25628945315styled-by-prettify" style=3D"color:#000">std</span><span class=
=3D"m_485155225628945315styled-by-prettify" style=3D"color:#660">::</span><=
span class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#000">=
is_same_v</span><span class=3D"m_485155225628945315styled-by-prettify" styl=
e=3D"color:#660">&lt;</span><span class=3D"m_485155225628945315styled-by-pr=
ettify" style=3D"color:#000">T</span><span class=3D"m_485155225628945315sty=
led-by-prettify" style=3D"color:#660">,</span><span class=3D"m_485155225628=
945315styled-by-prettify" style=3D"color:#000"> </span><span class=3D"m_485=
155225628945315styled-by-prettify" style=3D"color:#606">Us</span><span clas=
s=3D"m_485155225628945315styled-by-prettify" style=3D"color:#660">&gt;</spa=
n><span class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#00=
0"> </span><span class=3D"m_485155225628945315styled-by-prettify" style=3D"=
color:#660">||</span><span class=3D"m_485155225628945315styled-by-prettify"=
 style=3D"color:#000"> </span><span class=3D"m_485155225628945315styled-by-=
prettify" style=3D"color:#660">..</span><font color=3D"#000000"><span class=
=3D"m_485155225628945315styled-by-prettify" style=3D"color:#660">.</span><s=
pan class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#000"> =
</span><span class=3D"m_485155225628945315styled-by-prettify" style=3D"colo=
r:#660">);</span></font><span class=3D"m_485155225628945315styled-by-pretti=
fy" style=3D"color:#000"><br><br></span><span class=3D"m_485155225628945315=
styled-by-prettify" style=3D"color:#008">template</span><span class=3D"m_48=
5155225628945315styled-by-prettify" style=3D"color:#000"> </span><span clas=
s=3D"m_485155225628945315styled-by-prettify" style=3D"color:#660">&lt;</spa=
n><span class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#00=
8">typename</span><span class=3D"m_485155225628945315styled-by-prettify" st=
yle=3D"color:#000"> T</span><span class=3D"m_485155225628945315styled-by-pr=
ettify" style=3D"color:#660">&gt;</span><span class=3D"m_485155225628945315=
styled-by-prettify" style=3D"color:#000"><br>=C2=A0 =C2=A0 requires is_any_=
of_v</span><span class=3D"m_485155225628945315styled-by-prettify" style=3D"=
color:#660">&lt;</span><span class=3D"m_485155225628945315styled-by-prettif=
y" style=3D"color:#000">T</span><span class=3D"m_485155225628945315styled-b=
y-prettify" style=3D"color:#660">,</span><span class=3D"m_48515522562894531=
5styled-by-prettify" style=3D"color:#000"> </span><span class=3D"m_48515522=
5628945315styled-by-prettify" style=3D"color:#008">char</span><span class=
=3D"m_485155225628945315styled-by-prettify" style=3D"color:#660">*,</span><=
span class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#000">=
 std</span><span class=3D"m_485155225628945315styled-by-prettify" style=3D"=
color:#660">::</span><span class=3D"m_485155225628945315styled-by-prettify"=
 style=3D"color:#008">string</span><span class=3D"m_485155225628945315style=
d-by-prettify" style=3D"color:#660">,</span><span class=3D"m_48515522562894=
5315styled-by-prettify" style=3D"color:#000"> std</span><span class=3D"m_48=
5155225628945315styled-by-prettify" style=3D"color:#660">::</span><span cla=
ss=3D"m_485155225628945315styled-by-prettify" style=3D"color:#000">wstring<=
/span><span class=3D"m_485155225628945315styled-by-prettify" style=3D"color=
:#660">&gt;</span><span class=3D"m_485155225628945315styled-by-prettify" st=
yle=3D"color:#000"><br></span><span class=3D"m_485155225628945315styled-by-=
prettify" style=3D"color:#008">class</span><span class=3D"m_485155225628945=
315styled-by-prettify" style=3D"color:#000"> A</span><span class=3D"m_48515=
5225628945315styled-by-prettify" style=3D"color:#660">&lt;</span><span clas=
s=3D"m_485155225628945315styled-by-prettify" style=3D"color:#000">T</span><=
span class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#660">=
&gt;</span><span class=3D"m_485155225628945315styled-by-prettify" style=3D"=
color:#000"> </span><span class=3D"m_485155225628945315styled-by-prettify" =
style=3D"color:#660">{</span><span class=3D"m_485155225628945315styled-by-p=
rettify" style=3D"color:#000"> </span><span class=3D"m_485155225628945315st=
yled-by-prettify" style=3D"color:#660">...</span><span class=3D"m_485155225=
628945315styled-by-prettify" style=3D"color:#000"> </span><span class=3D"m_=
485155225628945315styled-by-prettify" style=3D"color:#660">};</span></div><=
/code></div><br>=C2=A0Or even:</div><div><br></div><div><div class=3D"m_485=
155225628945315prettyprint" style=3D"background-color:rgb(250,250,250);bord=
er-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:bre=
ak-word"><code class=3D"m_485155225628945315prettyprint"><div class=3D"m_48=
5155225628945315subprettyprint"><font color=3D"#660066"><span class=3D"m_48=
5155225628945315styled-by-prettify" style=3D"color:#008">template</span><sp=
an class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#000"> <=
/span><span class=3D"m_485155225628945315styled-by-prettify" style=3D"color=
:#660">&lt;</span><span class=3D"m_485155225628945315styled-by-prettify" st=
yle=3D"color:#008">typename</span><span class=3D"m_485155225628945315styled=
-by-prettify" style=3D"color:#000"> T</span><span class=3D"m_48515522562894=
5315styled-by-prettify" style=3D"color:#660">&gt;</span><span class=3D"m_48=
5155225628945315styled-by-prettify" style=3D"color:#000"><br></span><span c=
lass=3D"m_485155225628945315styled-by-prettify" style=3D"color:#008">concep=
t</span><span class=3D"m_485155225628945315styled-by-prettify" style=3D"col=
or:#000"> </span><span class=3D"m_485155225628945315styled-by-prettify" sty=
le=3D"color:#606">StringLike</span><span class=3D"m_485155225628945315style=
d-by-prettify" style=3D"color:#000"> </span><span class=3D"m_48515522562894=
5315styled-by-prettify" style=3D"color:#660">=3D</span><span class=3D"m_485=
155225628945315styled-by-prettify" style=3D"color:#000"> </span><span class=
=3D"m_485155225628945315styled-by-prettify" style=3D"color:#800">/* somethi=
ng sane */</span><span class=3D"m_485155225628945315styled-by-prettify" sty=
le=3D"color:#660">;</span><span class=3D"m_485155225628945315styled-by-pret=
tify" style=3D"color:#000"><br><br></span><span class=3D"m_4851552256289453=
15styled-by-prettify" style=3D"color:#008">template</span><span class=3D"m_=
485155225628945315styled-by-prettify" style=3D"color:#000"> </span><span cl=
ass=3D"m_485155225628945315styled-by-prettify" style=3D"color:#660">&lt;</s=
pan><span class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#=
606">StringLike</span><span class=3D"m_485155225628945315styled-by-prettify=
" style=3D"color:#000"> T</span><span class=3D"m_485155225628945315styled-b=
y-prettify" style=3D"color:#660">&gt;</span><span class=3D"m_48515522562894=
5315styled-by-prettify" style=3D"color:#000"><br></span><span class=3D"m_48=
5155225628945315styled-by-prettify" style=3D"color:#008">class</span><span =
class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#000"> A</s=
pan><span class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#=
660">&lt;</span><span class=3D"m_485155225628945315styled-by-prettify" styl=
e=3D"color:#000">T</span><span class=3D"m_485155225628945315styled-by-prett=
ify" style=3D"color:#660">&gt;</span><span class=3D"m_485155225628945315sty=
led-by-prettify" style=3D"color:#000"> </span><span class=3D"m_485155225628=
945315styled-by-prettify" style=3D"color:#660">{</span><span class=3D"m_485=
155225628945315styled-by-prettify" style=3D"color:#000"> </span><span class=
=3D"m_485155225628945315styled-by-prettify" style=3D"color:#660">...</span>=
<span class=3D"m_485155225628945315styled-by-prettify" style=3D"color:#000"=
> </span><span class=3D"m_485155225628945315styled-by-prettify" style=3D"co=
lor:#660">};</span></font></div></code></div><div><br></div>This language f=
eature is called Concepts, and is already in the working draft for C++20.</=
div><div><br></div></div><span>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/90cc934f-8532-4110-8d73-2824dabd51ec%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/90cc=
934f-8532-4110-<wbr>8d73-2824dabd51ec%40isocpp.org</a><wbr>.<br>
</blockquote></div><br></div>

<p></p>

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

--001a1141fd2698f3680567d61114--

.


Author: Richard Hodges <hodges.r@gmail.com>
Date: Tue, 20 Mar 2018 11:06:51 +0000
Raw View
--=-fDUHnu0CzJPVFGHGpzCE
Content-Type: multipart/alternative; boundary="=-EXS80p4WEXF0B+lwVsy5"


--=-EXS80p4WEXF0B+lwVsy5
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, 2018-03-20 at 02:20 -0700, Dejan Milosavljevic wrote:
> Hello
>=20
>   Here is simple idea how to use existing code to make several
> (partial) specialization at once.
>   Instead of one type use list of types.
>=20
>   Quick example:
> > template< typename T > //Primary template as we know
> >   class A {
> >      void print(){ std::cout << "Primary template" << std::endl; }
> >    };
> > template<>
> >   class A< { char*, std::string, std::wstring } > { // Instead one
> > type it is list of types.
> >      void print(){ std::cout << "String  specialization" <<
> > std::endl; }
> >    };
> >=20
>=20
> More details/examples in attachment.
> Source controlled file: https://github.com/dmilos/cpp_proposal/blob/m
> aster/multi_spec.html
>=20
> D.

At the moment, one idiomatic solution to multiple partial
specialisation would be template pattern matching.
Here's the problem expressed this way:
#include <iostream>#include <utility>
template<typename T, typename MatchCondition =3D void>struct A{    void
print()    {        std::cout << "Primary template" <<
std::endl;    }};
template<class T> struct is_stringlike : std::false_type {};template<>
struct is_stringlike<const char*> : std::true_type {};template<> struct
is_stringlike<std::string> : std::true_type {};template<> struct
is_stringlike<std::wstring> : std::true_type {};
template<typename T>struct A<T,
std::enable_if_t<is_stringlike<T>::value>>{    void
print()    {        std::cout << "String specialization" <<
std::endl;    }};
int main() {    auto a =3D A<int>();    a.print();
    auto b =3D A<const char*>();    b.print();}
Granted it involves some understanding of template meta-programming,
but it's pretty readable, no?


R
> =20
>=20
>=20
>=20
> --=20
>=20
> You received this message because you are subscribed to the Google
> Groups "ISO C++ Standard - Future Proposals" group.
>=20
> To unsubscribe from this group and stop receiving emails from it,
> send an email to std-proposals+unsubscribe@isocpp.org.
>=20
> To post to this group, send email to std-proposals@isocpp.org.
>=20
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/910830df-1a1c-4e32-8358-
> d24a4636d1b1%40isocpp.org.
>=20
>=20
>=20
>=20
> =20
>   [C++]Multiple (partial)specialization.
>  =20
>  =20
>  =20
>  =20
>  =20
>  =20
>  =20
>=20
>  =20
> <!--
>=20
> body {
>     margin-top: 20mm;
>     margin-right: 18mm;
>     margin-bottom: 20mm;
>     margin-left: 18mm;
>     border-width: 0;
>     padding-top: 0px;
>     padding-right: 0px;
>     padding-bottom: 0px;
>     padding-left: 0px;
>     margin: 0;
>     vertical-align: baseline;
>     font-size:16px;
> }
>=20
> table {
>      vertical-align: baseline;
> }
> .paragraf {
>     text-indent: 10pt;
> }
>=20
> .IndentedBlock3ex {
>     margin-left: 3ex;
> }
>=20
> .IndentedBlock2ex {
>     margin-left: 2ex;
> }
>=20
> .IndentedBlock1ex {
>     margin-left: 1ex;
> }
> .NovaStranica {
>     page-break-before: auto;
>     page-break-after: always;
> }
>=20
> .NaslovStranice
> {
>  font-size:30px;
>  font-weight:bold;
> }
>=20
> .NaslovGlavni
> {
>  font-size:28px;
>  font-weight:bold;
> }
>=20
> .NaslovPod
>  {
>   font-size: 22px;
>   font-weight:bold;
>  }
>=20
> .Naslovcic
>  {
>   font-size: 18px;
>   font-weight:bold;
>  }
>=20
> .NaslovcicJosManji
>  {
>   font-size: 16px;
>   font-weight:bold;
>  }
>=20
> .TextObican
>  {
>     font-size: 15px;
>  }
> .TOCItem
> {
>  font-size:18px;
>  font-weight:bold;
> }
>=20
>=20
> .NaslovDefinicije
> {
>     font-size: 10;
> }
>=20
> .TextCode
>  {
>     font-size: 12px;
>  }
>=20
> -->
>  =20
> =20
>=20
> =20
>    Multiple (partial)specialization=20
>   =20
>    =20
>      =20
>     =20
>       Document number:=20
>=20
>       Date:=20
>=20
>       Reply to:
>=20
>      =20
>=20
>     =20
>     =20
>      =20
>=20
>       2018/02/12
>=20
>       Dejan D.M. Milosavljevic
>=20
>       (dmilos at gmail dot com)
>=20
>     =20
>      =20
>    =20
>   =20
>   =20
>     Table of Contents.
>    =20
>     =20
>       I. Introduction
>       II. Motivation and Scope
>       III. Solutions
>       IV. Design Decisions
>       V. Impact On the Standard
>       VI. References
>     =20
>    =20
>=20
>    I. Introduction
>   =20
>      Multiple (partial)specialization.
>      This feature will allow multiple (partial)specialize of template
> without need for additional code.
>      It is assumed that extra/additional code is something that comes
> after class definition or (partial) specialization.
>=20
>=20
>   =20
>    II. Motivation and Scope
>=20
>      =20
>    Usual problem with template specialization is how to reuse
> existing code for other type.
>    One of idea is to have separate code for each type that will point
> to previous specialization. But this idea will rise more requests
> such as modification of existing functions and members.
>    This idea avoid those request by use of existing code at point of
> (partial)specialization.
>=20
>=20
>=20
>    It is often that some types can be grouped in manner that share
> same class specialization.
>    In presented example we have integer group( short, int, long ),
> rational ( float, double, long double ) and strng ( char*,
> std::string, std::wstring ).
>    =20
>      Problem 1:
>     =20
>        Lets make several groups of types. Each group heed their own
> specialization.
>=20
>        In next example we have two groups.
>=20
>        First group contain: char*,  std::string, std::wstring. Second
> group: float, double, long double.
>=20
>=20
>        Note: This example can be extended with more groups like
> signed integers, unsigned integers.
>=20
>=20
>=20
>=20
> [Example:
> > template< typename T >
> >  class A {
> >    void print(){ std::cout << "Primary template" << std::endl; }
> >   };
> >=20
> > template<>
> >  class A< std::string > {
> >    void print(){ std::cout << "String  specialization" <<
> > std::endl; }
> >   };
> > template<>
> >  class A< char* > { // NOTE: In here we keep "String
> > specialization".
> >    void print(){ std::cout << "String  specialization" <<
> > std::endl; }
> >   };
> >=20
> > template<>
> >  class A< std::wstring > { // NOTE: In here we keep "String
> > specialization".
> >    void print(){ std::cout << "String  specialization" <<
> > std::endl; }
> >   };
> >=20
> > template<>
> >  class A<float > {
> >    void print(){ std::cout << "Rational specialization" <<
> > std::endl; }
> >   };
> > template<>
> >  class A< double > { // NOTE: Same as foat
> >    void print(){ std::cout << "Rational  specialization" <<
> > std::endl; }
> >   };
> >=20
> > template<>
> >  class A< long double > { // NOTE: Same as foat
> >    void print(){ std::cout << "Rational  specialization" <<
> > std::endl; }
> >   };
> =E2=80=94end example]
>    =20
>     Problem 2:
>    =20
>       Lest start with some enum with enough large number of
> enumerants.
>=20
>       Goal is to specialize class E so the enum subgroups have same
> template specialization.
>=20
>       In this example first subgroup are consisted from red, green,
> blue.=20
>=20
>       Second subgroup: cyan, yellow and magenta.
>=20
>=20
>    =20
> [Example:
> > enum colors{ red, green, blue, cyan, magenta, yellow, orange, pink
> > };
> >=20
> > template< enum Colors color =3D red >
> >  class E {
> >     void print(){ std::cout << "Primary template with red
> > default"<< std::endl;  }
> >   };
> >=20
> > template< >
> >  class E< green > { // In here we want to keep primary definition
> > of print function
> >     void print(){ std::cout << "Primary template with red
> > default"<< std::endl;  }
> >   };
> >=20
> > template< >
> >  class E< blue > { // In here we want to keep primary definition of
> > print function
> >     void print(){ std::cout << "Primary template with red
> > default"<< std::endl;  }
> >   };
> >=20
> > template< >
> >  class E< yellow > { // Brand new specialization of print function
> >     void print(){ std::cout << "YELLOW"<< std::endl;  }
> >   };
> >=20
> > template< >
> >  class E< magenta > { // Same as E< yellow >
> >     void print(){ std::cout << "YELLOW"<< std::endl;  }
> >   };
> >=20
> >   // etc
> =E2=80=94end example]
>=20
>    =20
>=20
>     Problem 3:
>      =20
>          Similarly like for enums, in here some groups of integers
> need to share same specialization.
>          Specialize for specific integer values.
>=20
>=20
>=20
>         =20
> [Example:
> > template< unsigned number>
> >  class I {
> >     void print(){ std::cout << "Primary template." << std::endl; }
> >   };
> >=20
> > template< >
> >  class I< 0 > {
> >     void print(){ std::cout << " up to 10 and 10 ." << std::endl; }
> >   };
> >  /* In here repeat above code with numbers between 1 and 10*/
> > template< >
> >  class I< 10 > {
> >     void print(){ std::cout << " up to 10 and 10." << std::endl; }
> >   };
> >=20
> > template< >
> >  class I< 11 > {
> >     void print(){ std::cout << " up to 100 and 100." << std::endl;
> > }
> >   };
> >  /* repeat above code with numbers between 11 and 100*/
> > template< >  class I< 100 >
> >   {
> >     void print(){ std::cout << " up to 100 and 100." << std::endl;
> > }
> >   };
> =E2=80=94end example]
>      =20
>   =20
>    =20
>=20
>=20
>  =20
>  =20
>   III. Solutions
>=20
>  =20
>    Solutions within current standard=20
>   =20
>    =20
>       Using copy/paste
>      =20
>        Already demonstrated in above examples. Lacks are obvious and
> well known.
>      =20
>        By using macro replacement ( #define ).
>      =20
>=20
> [Example:
> > template< typename T >
> >  class A {
> >    void print(){ std::cout << "Primary template" << std::endl; }
> >   };
> >=20
> > #define A_for_string(string_like_type)    \
> >     template< >    \
> >      class A< string_like_type T > {    \
> >        void print(){ std::cout << "String template" << std::endl;
> > }    \
> >       }
> >=20
> > A_for_string( char* );
> > A_for_string( std::string );
> > A_for_string( std::wsring );
> =E2=80=94end example]
>=20
> Replacing template with #define is bad idea.
> And again lacks are obvious and well known.
>=20
>      =20
>       Involving the inheritance
>      =20
>=20
> [Example:
> > template< typename T >
> >  class A {
> >    void print(){ std::cout << "Primary template" << std::endl; }
> >   };
> >=20
> > template< typename string_like_type >
> >  class A_string {
> >    void print(){ std::cout << "String template" << std::endl; }
> >   }
> >=20
> > template<>
> >  class A< std::string >
> >   : public A_string< std::string > {
> >    // nothing
> >   };
> >=20
> > template<>
> >  class A< std::wstring >
> >   : public A_string< std::wstring > {
> >    // nothing
> >   };
> =E2=80=94end example]
>      =20
> In this case there is additional class that need to bi hidden from
> user. This can be consider as code bloat.
>=20
>      =20
>    =20
>   =20
>=20
>    Proposal
>    =20
>       Use list of types in place on one type. Type list should be
> enclosed with '{' and '}'.
>=20
>       All examples can be easily extended in partial specialization
> examples.
>     =20
>        float, string, ints:
>       =20
>         Generalized primary template. Several specialized templates
> at once with list of types
>=20
>=20
> [Example:
> > template< typename T > // Primary template. As per standard
> >  class A {
> >    void print(){ std::cout << "Primary template" << std::endl; }
> >   };
> >=20
> > template<>
> >  class A< { char*, std::string, std::wstring } > { // Instead one
> > type it is list of types.
> >    void print(){ std::cout << "String  specialization" <<
> > std::endl; }
> >   };
> >=20
> > template<>
> >  class A< { float, double, long double } > {
> >    void print(){ std::cout << "Rational specialization" <<
> > std::endl; }
> >   };
> >=20
> > template< typename T >=20
> >  class A< std::vector < { T, short, int, long } > > { // Partial
> > and and full specialization at once.
> >    void print(){ std::cout << "std::vector < Integers >" <<
> > std::endl; }
> >   };
> =E2=80=94end example]
>=20
>=20
>=20
> enums:
>=20
>  Primary template with default parameter and two more types (
> actually enums ).
>=20
>  Enums must appear in ascending order.
>=20
>=20
> [Example:
> > enum colors{ red, green, blue, cyan, yellow, magenta, orange, pink
> > };
> >=20
> > // red is default, Other enums in list must appear in order of
> > appearance in their definition.
> > template< enum Colors color =3D red { red, ... , blue } >
> >  class E {
> >     void print(){ std::cout << "Primary template with red
> > default"<< std::endl;  }
> >   };
> >=20
> > template< >
> >  class E< { cyan, ... , yellow } > { // Take all enums between cyan
> > and key
> >   // Brand new specialization of print function
> >     void print(){ std::cout << "YELLOW"<< std::endl;  }
> >   };
> =E2=80=94end example]
>=20
>=20
> Integer:
>=20
>  Demonstration of massive specialization on very small space.=20
>=20
>  Only integral types can use ellipsis.
>=20
>  Numbers must appear in ascending order.
>=20
>=20
> [Example:
> > template< unsigned number =3D 0 >
> >  class I {
> >     void print(){ std::cout << "Primary template." << std::endl; }
> >   };
> >=20
> > template< >
> >  class I< { 1, ..., 10 } >{ // Numbers must appear in increasing
> > order
> >     void print(){ std::cout << " up to 10 and 10 ." << std::endl; }
> >   };
> >=20
> > template< >
> >  class I< { 11, ..., 100 } > {
> >     void print(){ std::cout << " from 11 to 100 and 100." <<
> > std::endl; }
> >   };
> >=20
> > template< >
> >  class I< 42 >{ // ERROR: Already specialized.
> >   {
> >     void print(){ std::cout << " 42." << std::endl; }
> >   };
> =E2=80=94end example]
>=20
>=20
>  Multi specialization on two ( or more ) parameters:
>=20
>=20
> When two or more parameters are list of types ( or integers ) all
> pairs ( tuples ) will be specialized.
>=20
>=20
> [Example:
> > template< typename S, typename T >
> >  class D {
> >     void print(){ std::cout << "Primary template." << std::endl; }
> >   };
> >=20
> > template< >
> >  class D< { int, long }, { std::string, std::wstring } >{
> >     void print(){ std::cout << "{ int, long }, { std::string,
> > std::wstring }" << std::endl; }
> >   };
> >=20
> > template< >
> >  class D< int, std::wstring >{ // ERROR: Specialization already
> > exists
> >     void print(){ std::cout << " int, std::wstring " << std::endl;
> > }
> >   };
> =E2=80=94end example]
>=20
>=20
>=20
> It is not possible to have some exception for some pair ( tuples ) of
> types.
>=20
> [Example:
> > template< typename S, typename T >
> >  class E {
> >     void print(){ std::cout << "Primary template." << std::endl; }
> >   };
> >=20
> > template< >
> >  class E< int, std::wstring >{ // OK. Specialization for int and
> > std::wstring
> >     void print(){ std::cout << " int, std::wstring " << std::endl;
> > }
> >   };
> >  =20
> > template< >
> >  class E< { int, long }, { std::string, std::wstring } >{ // ERROR:
> > One pair is already specialized.
> >     void print(){ std::cout << "{ int, long }, { std::string,
> > std::wstring }" << std::endl; }
> >   };
> >=20
> =E2=80=94end example]
>=20
>=20
>    =20
>   =20
>  =20
> =20
> =20
>    IV. Design Decisions
>   =20
>      =20
>        Massive (partial)specialization at the cost of one definition.
>        Due to fact the that same code are shared with other types it
> is not possible make different implementation mistakenly for some
> type of same group.
>        There is no need for additional code like in N3596 or similar
> solution. Which is one of the main goal i.e no additional code. One
> place and start place only.
>        Do not solve (and not intention): Reuse of existing
> (partial)specialization by modification, function/member
> excluding/adding/redefining.
>       =20
>   =20
>    =20
>    =20
>   =20
>=20
>    V. Impact On the Standard
>   =20
>     =20
>         Core=20
>        No effect.
>=20
>            No new keywords.=20
>=20
>            No new tokens.=20
>=20
>            No changes to old syntax.=20
>=20
>            Pure extension.=20
>=20
>            Backward compatible.
>       =20
>        Library
>        No effect.
>  No new class.
>  No new functions.=20
>        Existing code.
>        No effect.
>=20
>     =20
>   =20
>  =20
>  =20
> =20
>=20
>=20
>=20
>=20
>=20
>=20
>=20

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

--=-EXS80p4WEXF0B+lwVsy5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<html xmlns=3D"http://www.w3.org/1999/xhtml"><head></head><body class=3D"Te=
xtObican"><div>On Tue, 2018-03-20 at 02:20 -0700, Dejan Milosavljevic wrote=
:</div><blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex; border-left:2p=
x #729fcf solid;padding-left:1ex"><div dir=3D"ltr"><div>Hello</div><div><br=
></div><div>&nbsp; Here is simple idea how to use existing code to make sev=
eral (partial) specialization at once.</div><div>&nbsp; Instead of one type=
 use list of types.</div><div><br></div><div>&nbsp; Quick example:</div><bl=
ockquote dir=3D"ltr" type=3D"cite" style=3D"margin:0 0 0 .8ex; border-left:=
2px #729fcf solid;padding-left:1ex"><div><font face=3D"courier new,monospac=
e">template&lt; typename T &gt; //Primary template as we know<br>&nbsp; cla=
ss A {<br>&nbsp;&nbsp;&nbsp;&nbsp; void print(){ std::cout &lt;&lt; "Primar=
y template" &lt;&lt; std::endl; }<br>&nbsp;&nbsp; };</font></div><div><font=
 face=3D"courier new,monospace">template&lt;&gt;<br>&nbsp; class A&lt; { ch=
ar*, std::string, std::wstring } &gt; { // Instead one type it is list of t=
ypes.<br>&nbsp;&nbsp;&nbsp;&nbsp; void print(){ std::cout &lt;&lt; "String&=
nbsp; specialization" &lt;&lt; std::endl; }<br>&nbsp;&nbsp; };</font></div>=
<div><b><font face=3D"courier new,monospace"><br></font></b></div></blockqu=
ote><div><br></div><div>More details/examples in attachment.</div><div>Sour=
ce controlled file:&nbsp;https://github.com/dmilos/cpp_proposal/blob/master=
/multi_spec.html</div><div><br></div><div>D.</div></div></blockquote><div><=
br></div><div>At the moment, one idiomatic solution to multiple partial spe=
cialisation would be template pattern matching.</div><div><br></div><div>He=
re's the problem expressed this way:</div><div><br></div><div><div style=3D=
"color: #000000;background-color: #fffffe;font-family: Consolas, " liberati=
on=3D"" mono",=3D"" courier,=3D"" monospace;font-weight:=3D"" normal;font-s=
ize:=3D"" 14px;line-height:=3D"" 19px;white-space:=3D"" pre;"=3D""><div><sp=
an style=3D"color: #0000ff;">#include</span> &lt;iostream&gt;</div><div><sp=
an style=3D"color: #0000ff;">#include</span> &lt;utility&gt;</div><br><div>=
<span style=3D"color: #0000ff;">template</span>&lt;<span style=3D"color: #0=
000ff;">typename</span> T, <span style=3D"color: #0000ff;">typename</span> =
MatchCondition =3D <span style=3D"color: #0000ff;">void</span>&gt;</div><di=
v><span style=3D"color: #0000ff;">struct</span> A</div><div>{</div><div>   =
 <span style=3D"color: #0000ff;">void</span> print()</div><div>    {</div><=
div>        std::cout &lt;&lt; <span style=3D"color: #a31515;">"Primary tem=
plate"</span> &lt;&lt; std::endl;</div><div>    }</div><div>};</div><br><di=
v><span style=3D"color: #0000ff;">template</span>&lt;<span style=3D"color: =
#0000ff;">class</span> T&gt; <span style=3D"color: #0000ff;">struct</span> =
is_stringlike : std::false_type {};</div><div><span style=3D"color: #0000ff=
;">template</span>&lt;&gt; <span style=3D"color: #0000ff;">struct</span> is=
_stringlike&lt;<span style=3D"color: #0000ff;">const</span> <span style=3D"=
color: #0000ff;">char</span>*&gt; : std::true_type {};</div><div><span styl=
e=3D"color: #0000ff;">template</span>&lt;&gt; <span style=3D"color: #0000ff=
;">struct</span> is_stringlike&lt;std::string&gt; : std::true_type {};</div=
><div><span style=3D"color: #0000ff;">template</span>&lt;&gt; <span style=
=3D"color: #0000ff;">struct</span> is_stringlike&lt;std::wstring&gt; : std:=
:true_type {};</div><br><div><span style=3D"color: #0000ff;">template</span=
>&lt;<span style=3D"color: #0000ff;">typename</span> T&gt;</div><div><span =
style=3D"color: #0000ff;">struct</span> A&lt;T, std::enable_if_t&lt;is_stri=
nglike&lt;T&gt;::value&gt;&gt;</div><div>{</div><div>    <span style=3D"col=
or: #0000ff;">void</span> print()</div><div>    {</div><div>        std::co=
ut &lt;&lt; <span style=3D"color: #a31515;">"String specialization"</span> =
&lt;&lt; std::endl;</div><div>    }</div><div>};</div><br><div><span style=
=3D"color: #0000ff;">int</span> main() </div><div>{</div><div>    <span sty=
le=3D"color: #0000ff;">auto</span> a =3D A&lt;<span style=3D"color: #0000ff=
;">int</span>&gt;();</div><div>    a.print();</div><br><div>    <span style=
=3D"color: #0000ff;">auto</span> b =3D A&lt;<span style=3D"color: #0000ff;"=
>const</span> <span style=3D"color: #0000ff;">char</span>*&gt;();</div><div=
>    b.print();</div><div>}</div><br></div><div style=3D"color: #000000;bac=
kground-color: #fffffe;font-family: Consolas, " liberation=3D"" mono",=3D""=
 courier,=3D"" monospace;font-weight:=3D"" normal;font-size:=3D"" 14px;line=
-height:=3D"" 19px;white-space:=3D"" pre;"=3D""><span style=3D"color: rgb(4=
6, 52, 54); background-color: rgb(255, 255, 255);">Granted it involves some=
 understanding of template meta-programming, but it's pretty readable, no?<=
/span></div><div style=3D"color: #000000;background-color: #fffffe;font-fam=
ily: Consolas, " liberation=3D"" mono",=3D"" courier,=3D"" monospace;font-w=
eight:=3D"" normal;font-size:=3D"" 14px;line-height:=3D"" 19px;white-space:=
=3D"" pre;"=3D""><span style=3D"color: rgb(46, 52, 54); background-color: r=
gb(255, 255, 255);"><br></span></div><div style=3D"color: #000000;backgroun=
d-color: #fffffe;font-family: Consolas, " liberation=3D"" mono",=3D"" couri=
er,=3D"" monospace;font-weight:=3D"" normal;font-size:=3D"" 14px;line-heigh=
t:=3D"" 19px;white-space:=3D"" pre;"=3D""><span style=3D"color: rgb(46, 52,=
 54); background-color: rgb(255, 255, 255);">R</span></div><div style=3D"co=
lor: #000000;background-color: #fffffe;font-family: Consolas, " liberation=
=3D"" mono",=3D"" courier,=3D"" monospace;font-weight:=3D"" normal;font-siz=
e:=3D"" 14px;line-height:=3D"" 19px;white-space:=3D"" pre;"=3D""><span styl=
e=3D"color: rgb(46, 52, 54); background-color: rgb(255, 255, 255);"><br></s=
pan></div></div><blockquote type=3D"cite" style=3D"margin:0 0 0 .8ex; borde=
r-left:2px #729fcf solid;padding-left:1ex"><div dir=3D"ltr"><div>&nbsp;</di=
v></div>



-- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/910830df-1a1c-4e32-8358-d24a4636d1b1%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter">https://groups.goo=
gle.com/a/isocpp.org/d/msgid/std-proposals/910830df-1a1c-4e32-8358-d24a4636=
d1b1%40isocpp.org</a>.<br>
<!-- text/html -->


=20
  <title>[C++]Multiple (partial)specialization.</title>
 =20
 =20
 =20
 =20
 =20
 =20
 =20

  <style type=3D"text/css">
<!--

body {
    margin-top: 20mm;
    margin-right: 18mm;
    margin-bottom: 20mm;
    margin-left: 18mm;
    border-width: 0;
    padding-top: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
    margin: 0;
    vertical-align: baseline;
    font-size:16px;
}

table {
     vertical-align: baseline;
}
..paragraf {
    text-indent: 10pt;
}

..IndentedBlock3ex {
    margin-left: 3ex;
}

..IndentedBlock2ex {
    margin-left: 2ex;
}

..IndentedBlock1ex {
    margin-left: 1ex;
}
..NovaStranica {
    page-break-before: auto;
    page-break-after: always;
}

..NaslovStranice
{
 font-size:30px;
 font-weight:bold;
}

..NaslovGlavni
{
 font-size:28px;
 font-weight:bold;
}

..NaslovPod
 {
  font-size: 22px;
  font-weight:bold;
 }

..Naslovcic
 {
  font-size: 18px;
  font-weight:bold;
 }

..NaslovcicJosManji
 {
  font-size: 16px;
  font-weight:bold;
 }

..TextObican
 {
    font-size: 15px;
 }
..TOCItem
{
 font-size:18px;
 font-weight:bold;
}


..NaslovDefinicije
{
    font-size: 10;
}

..TextCode
 {
    font-size: 12px;
 }

-->
  </style>
=20

=20
  <h1 align=3D"center"> <div class=3D"NaslovStranice">Multiple (partial)spe=
cialization</div> </h1>
   <table border=3D"0" width=3D"100%">
    <tbody><tr>
     <td width=3D"100%">&nbsp;</td>
     <td nowrap=3D"nowrap">
      Document number: <br>
      Date: <br>
      Reply to:<br>
      <br>
     </td>
     <td nowrap=3D"nowrap">
      <br>
      2018/02/12<br>
      Dejan D.M. Milosavljevic<br>
      (dmilos at gmail dot com)<br>
     </td>
     <td width=3D"10%">&nbsp;</td>
    </tr>
   </tbody></table>
   <dl>
    <dt><div class=3D"NaslovGlavni">Table of Contents.</div></dt>
    <dd>
     <ul>
      <li><div class=3D"TOCItem">I. Introduction</div></li>
      <li><div class=3D"TOCItem">II. Motivation and Scope</div></li>
      <li><div class=3D"TOCItem">III. Solutions</div></li>
      <li><div class=3D"TOCItem">IV. Design Decisions</div></li>
      <li><div class=3D"TOCItem">V. Impact On the Standard</div></li>
      <li><div class=3D"TOCItem">VI. References</div></li>
     </ul>
    </dd>

   <dt><div class=3D"NaslovGlavni">I. Introduction</div></dt>
   <dd>
     Multiple (partial)specialization.
     This feature will allow multiple (partial)specialize of template witho=
ut need for additional code.
     It is assumed that extra/additional code is something that comes after=
 class definition or (partial) specialization.<br><br>
   </dd>
   <dt><div class=3D"NaslovGlavni">II. Motivation and Scope</div></dt>

      <dd>
   Usual problem with template specialization is how to reuse existing code=
 for other type.
   One of idea is to have separate code for each type that will point to pr=
evious specialization. But this idea will rise more requests such as modifi=
cation of existing functions and members.
   This idea avoid those request by use of existing code at point of (parti=
al)specialization.<br><br>

   It is often that some types can be grouped in manner that share same cla=
ss specialization.
   In presented example we have integer group( short, int, long ), rational=
 ( float, double, long double ) and strng ( char*, std::string, std::wstrin=
g ).
    <dl>
     <dt class=3D"Naslovcic">Problem 1:</dt>
     <dd>
       Lets make several groups of types. Each group heed their own special=
ization.<br>
       In next example we have two groups.<br>
       First group contain: <code>char*</code>,  <code>std::string</code>, =
<code>std::wstring</code>. Second group: <code>float</code>, <code>double</=
code>, <code>long double</code>.<br>

       Note: This example can be extended with more groups like signed inte=
gers, unsigned integers.<br><br>

<br>[<i>Example</i>:<code><blockquote type=3D"cite" style=3D"margin:0 0 0 .=
8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre class=3D"TextCode=
">template&lt; typename T &gt;
 class A {
   void print(){ std::cout &lt;&lt; "Primary template" &lt;&lt; std::endl; =
}
  };

template&lt;&gt;
 class A&lt; std::string &gt; {
   void print(){ std::cout &lt;&lt; "String  specialization" &lt;&lt; std::=
endl; }
  };
template&lt;&gt;
 class A&lt; char* &gt; { // NOTE: In here we keep "String specialization".
   void print(){ std::cout &lt;&lt; "String  specialization" &lt;&lt; std::=
endl; }
  };

template&lt;&gt;
 class A&lt; std::wstring &gt; { // NOTE: In here we keep "String specializ=
ation".
   void print(){ std::cout &lt;&lt; "String  specialization" &lt;&lt; std::=
endl; }
  };

template&lt;&gt;
 class A&lt;float &gt; {
   void print(){ std::cout &lt;&lt; "Rational specialization" &lt;&lt; std:=
:endl; }
  };
template&lt;&gt;
 class A&lt; double &gt; { // NOTE: Same as <b>foat</b>
   void print(){ std::cout &lt;&lt; "Rational  specialization" &lt;&lt; std=
::endl; }
  };

template&lt;&gt;
 class A&lt; long double &gt; { // NOTE: Same as <b>foat</b>
   void print(){ std::cout &lt;&lt; "Rational  specialization" &lt;&lt; std=
::endl; }
  };
</pre></blockquote></code>=E2=80=94<i>end example</i>]
    </dd>
    <dt class=3D"Naslovcic">Problem 2:</dt>
    <dd>
      Lest start with some enum with enough large number of enumerants.<br>
      Goal is to specialize <code>class E</code> so the enum subgroups have=
 same template specialization.<br>
      In this example first subgroup are consisted from <code>red</code>, <=
code>green</code>, <code>blue</code>. <br>
      Second subgroup: <code>cyan</code>, <code>yellow</code> and <code>mag=
enta</code>.<br><br>
    <br>[<i>Example</i>:<code><blockquote type=3D"cite" style=3D"margin:0 0=
 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre class=3D"Text=
Code">
enum colors{ red, green, blue, cyan, magenta, yellow, orange, pink };

template&lt; enum Colors color =3D red &gt;
 class E {
    void print(){ std::cout &lt;&lt; "Primary template with red default"&lt=
;&lt; std::endl;  }
  };

template&lt; &gt;
 class E&lt; green &gt; { // In here we want to keep primary definition of =
<i>print</i> function
    void print(){ std::cout &lt;&lt; "Primary template with red default"&lt=
;&lt; std::endl;  }
  };

template&lt; &gt;
 class E&lt; blue &gt; { // In here we want to keep primary definition of <=
i>print</i> function
    void print(){ std::cout &lt;&lt; "Primary template with red default"&lt=
;&lt; std::endl;  }
  };

template&lt; &gt;
 class E&lt; yellow &gt; { // Brand new specialization of <i>print</i> func=
tion
    void print(){ std::cout &lt;&lt; "YELLOW"&lt;&lt; std::endl;  }
  };

template&lt; &gt;
 class E&lt; magenta &gt; { // Same as E&lt; yellow &gt;
    void print(){ std::cout &lt;&lt; "YELLOW"&lt;&lt; std::endl;  }
  };

  // etc
</pre></blockquote></code>=E2=80=94<i>end example</i>]

    </dd>

    <dt class=3D"Naslovcic">Problem 3:</dt>
      <dd>
         Similarly like for enums, in here some groups of integers need to =
share same specialization.
         Specialize for specific integer values.<br>


         <br>[<i>Example</i>:<code><blockquote type=3D"cite" style=3D"margi=
n:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre class=3D=
"TextCode">
template&lt; unsigned number&gt;
 class I {
    void print(){ std::cout &lt;&lt; "Primary template." &lt;&lt; std::endl=
; }
  };

template&lt; &gt;
 class I&lt; 0 &gt; {
    void print(){ std::cout &lt;&lt; " up to 10 and 10 ." &lt;&lt; std::end=
l; }
  };
 /* In here repeat above code with numbers between 1 and 10*/
template&lt; &gt;
 class I&lt; 10 &gt; {
    void print(){ std::cout &lt;&lt; " up to 10 and 10." &lt;&lt; std::endl=
; }
  };

template&lt; &gt;
 class I&lt; 11 &gt; {
    void print(){ std::cout &lt;&lt; " up to 100 and 100." &lt;&lt; std::en=
dl; }
  };
 /* repeat above code with numbers between 11 and 100*/
template&lt; &gt;  class I&lt; 100 &gt;
  {
    void print(){ std::cout &lt;&lt; " up to 100 and 100." &lt;&lt; std::en=
dl; }
  };
</pre></blockquote></code>=E2=80=94<i>end example</i>]
      </dd>
   </dl>
    <br><br>
  <p class=3D"NovaStranica"></p>
  </dd>
  <dt><div class=3D"NaslovGlavni">III. Solutions</div></dt>
<dd>
  <dl>
   <dt class=3D"Naslovcic">Solutions within current standard </dt>
   <dd>
    <dl>
      <dt class=3D"NaslovcicJosManji">Using copy/paste</dt>
      <dd>
       Already demonstrated in above examples. Lacks are obvious and well k=
nown.
      </dd>
      <dt class=3D"NaslovcicJosManji"> By using macro replacement ( <code>#=
define</code> ).</dt>
      <dd>
<br>[<i>Example</i>:<code><blockquote type=3D"cite" style=3D"margin:0 0 0 .=
8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre class=3D"TextCode=
">template&lt; typename T &gt;
 class A {
   void print(){ std::cout &lt;&lt; "Primary template" &lt;&lt; std::endl; =
}
  };

#define A_for_string(string_like_type)    \
    template&lt; &gt;    \
     class A&lt; string_like_type T &gt; {    \
       void print(){ std::cout &lt;&lt; "String template" &lt;&lt; std::end=
l; }    \
      }

A_for_string( char* );
A_for_string( std::string );
A_for_string( std::wsring );
</pre></blockquote></code>=E2=80=94<i>end example</i>]

Replacing template with <code>#define</code> is bad idea.
And again lacks are obvious and well known.

      </dd>
      <dt class=3D"NaslovcicJosManji">Involving the inheritance</dt>
      <dd>
<br>[<i>Example</i>:<code><blockquote type=3D"cite" style=3D"margin:0 0 0 .=
8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre class=3D"TextCode=
">template&lt; typename T &gt;
 class A {
   void print(){ std::cout &lt;&lt; "Primary template" &lt;&lt; std::endl; =
}
  };

template&lt; typename string_like_type &gt;
 class A_string {
   void print(){ std::cout &lt;&lt; "String template" &lt;&lt; std::endl; }
  }

template&lt;&gt;
 class A&lt; std::string &gt;
  : public A_string&lt; std::string &gt; {
   // nothing
  };

template&lt;&gt;
 class A&lt; std::wstring &gt;
  : public A_string&lt; std::wstring &gt; {
   // nothing
  };
</pre></blockquote></code>=E2=80=94<i>end example</i>]
      <br>In this case there is additional class that need to bi hidden fro=
m user. This can be consider as code bloat.

      </dd>
    </dl>
   </dd>

   <dt class=3D"Naslovcic">Proposal</dt>
    <dd>
      Use list of types in place on one type. Type list should be enclosed =
with '{' and '}'.<br>
      All examples can be easily extended in partial specialization example=
s.
     <dl>
       <dt>float, string, ints:</dt>
       <dd>
        Generalized primary template. Several specialized templates at once=
 with list of types

<br>[<i>Example</i>:<code><blockquote type=3D"cite" style=3D"margin:0 0 0 .=
8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre class=3D"TextCode=
">template&lt; typename T &gt; // Primary template. As per standard
 class A {
   void print(){ std::cout &lt;&lt; "Primary template" &lt;&lt; std::endl; =
}
  };

template&lt;&gt;
 class A&lt; <b>{ char*, std::string, std::wstring }</b> &gt; { // Instead =
one type it is list of types.
   void print(){ std::cout &lt;&lt; "String  specialization" &lt;&lt; std::=
endl; }
  };

template&lt;&gt;
 class A&lt; <b>{ float, double, long double }</b> &gt; {
   void print(){ std::cout &lt;&lt; "Rational specialization" &lt;&lt; std:=
:endl; }
  };

template&lt; typename T &gt;=20
 class A&lt; std::vector &lt; <b>{ T, short, int, long }</b> &gt; &gt; { //=
 Partial and and full specialization at once.
   void print(){ std::cout &lt;&lt; "std::vector &lt; Integers &gt;" &lt;&l=
t; std::endl; }
  };
</pre></blockquote></code>=E2=80=94<i>end example</i>]
</dd>


<dt>enums:</dt>
<dd>
 Primary template with default parameter and two more types ( actually enum=
s ).<br>
 Enums must appear in ascending order.

<br>[<i>Example</i>:<code><blockquote type=3D"cite" style=3D"margin:0 0 0 .=
8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre class=3D"TextCode=
">enum colors{ red, green, blue, cyan, yellow, magenta, orange, pink };

// red is default, Other enums in list must appear in order of appearance i=
n their definition.
template&lt; enum Colors color =3D red <b>{ red, ... , blue }</b> &gt;
 class E {
    void print(){ std::cout &lt;&lt; "Primary template with red default"&lt=
;&lt; std::endl;  }
  };

template&lt; &gt;
 class E&lt; <b>{ cyan, ... , yellow }</b> &gt; { // Take all enums between=
 cyan and key
  // Brand new specialization of <i>print</i> function
    void print(){ std::cout &lt;&lt; "YELLOW"&lt;&lt; std::endl;  }
  };
</pre></blockquote></code>=E2=80=94<i>end example</i>]
</dd>

<dt>Integer:</dt>
<dd>
 Demonstration of massive specialization on very small space. <br>
 Only integral types can use ellipsis.<br>
 Numbers must appear in ascending order.

<br>[<i>Example</i>:<code><blockquote type=3D"cite" style=3D"margin:0 0 0 .=
8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre class=3D"TextCode=
">template&lt; unsigned number =3D 0 &gt;
 class I {
    void print(){ std::cout &lt;&lt; "Primary template." &lt;&lt; std::endl=
; }
  };

template&lt; &gt;
 class I&lt; <b>{ 1, ..., 10 }</b> &gt;{ // Numbers must appear in increasi=
ng order
    void print(){ std::cout &lt;&lt; " up to 10 and 10 ." &lt;&lt; std::end=
l; }
  };

template&lt; &gt;
 class I&lt; <b>{ 11, ..., 100 }</b> &gt; {
    void print(){ std::cout &lt;&lt; " from 11 to 100 and 100." &lt;&lt; st=
d::endl; }
  };

template&lt; &gt;
 class I&lt; 42 &gt;{ // ERROR: Already specialized.
  {
    void print(){ std::cout &lt;&lt; " 42." &lt;&lt; std::endl; }
  };
</pre></blockquote></code>=E2=80=94<i>end example</i>]
</dd>

<dt> Multi specialization on two ( or more ) parameters:</dt>
<dd>

When two or more parameters are list of types ( or integers ) all pairs ( t=
uples ) will be specialized.

<br>[<i>Example</i>:<code><blockquote type=3D"cite" style=3D"margin:0 0 0 .=
8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre class=3D"TextCode=
">template&lt; typename S, typename T &gt;
 class D {
    void print(){ std::cout &lt;&lt; "Primary template." &lt;&lt; std::endl=
; }
  };

template&lt; &gt;
 class D&lt; <b>{ int, long }, { std::string, std::wstring }</b> &gt;{
    void print(){ std::cout &lt;&lt; "{ int, long }, { std::string, std::ws=
tring }" &lt;&lt; std::endl; }
  };

template&lt; &gt;
 class D&lt; <b>int, std::wstring </b>&gt;{ // ERROR: Specialization alread=
y exists
    void print(){ std::cout &lt;&lt; " int, std::wstring " &lt;&lt; std::en=
dl; }
  };
</pre></blockquote></code>=E2=80=94<i>end example</i>]
<br><br>
It is not possible to have some exception for some pair ( tuples ) of types=
..
<br>[<i>Example</i>:<code><blockquote type=3D"cite" style=3D"margin:0 0 0 .=
8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre class=3D"TextCode=
">template&lt; typename S, typename T &gt;
 class E {
    void print(){ std::cout &lt;&lt; "Primary template." &lt;&lt; std::endl=
; }
  };

template&lt; &gt;
 class E&lt; <b>int, std::wstring </b>&gt;{ // OK. Specialization for int a=
nd std::wstring
    void print(){ std::cout &lt;&lt; " int, std::wstring " &lt;&lt; std::en=
dl; }
  };
 =20
template&lt; &gt;
 class E&lt; <b>{ int, long }, { std::string, std::wstring }</b> &gt;{ // E=
RROR: One pair is already specialized.
    void print(){ std::cout &lt;&lt; "{ int, long }, { std::string, std::ws=
tring }" &lt;&lt; std::endl; }
  };

</pre></blockquote></code>=E2=80=94<i>end example</i>]

</dd>
    </dl>
   </dd>
  </dl>
 <p class=3D"NovaStranica"></p>
 </dd>
   <dt><div class=3D"NaslovGlavni">IV. Design Decisions</div></dt>
   <dd>
      <ul>
       <li>Massive (partial)specialization at the cost of one definition.</=
li>
       <li>Due to fact the that same code are shared with other types it is=
 not possible make different implementation mistakenly for some type of sam=
e group.</li>
       <li>There is no need for additional code like in N3596 or similar so=
lution. Which is one of the main goal i.e no additional code. One place and=
 start place only.</li>
       <li>Do not solve (and not intention): Reuse of existing (partial)spe=
cialization by modification, function/member excluding/adding/redefining.
       </li>
   </ul>
    <dl>
    </dl>
   </dd>

   <dt><div class=3D"NaslovGlavni">V. Impact On the Standard</div></dt>
   <dd>
     <dl>
       <dt> <div class=3D"NaslovPod ">Core</div> </dt>
       <dd>No effect.<br>
           No new keywords. <br>
           No new tokens. <br>
           No changes to old syntax. <br>
           Pure extension. <br>
           Backward compatible.
       </dd>
       <dt><div class=3D"NaslovPod ">Library</div></dt>
       <dd>No effect.<br> No new class.<br> No new functions. </dd>
       <dt><div class=3D"NaslovPod ">Existing code.</div></dt>
       <dd>No effect.<br>
     </dd></dl>
   </dd>
  </dl>
 =20
=20







</blockquote></body></html>

<p></p>

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

--=-EXS80p4WEXF0B+lwVsy5--

--=-fDUHnu0CzJPVFGHGpzCE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEE3RJb20ryY2ALx0Tw6HZ1IvK3CgsFAlqw60sACgkQ6HZ1IvK3
CgttIw/+O/Hqgf0nVwYWiE1GVkG9T1llgQpeSqV4oQx3/9/zXlYGRYbQoTIVuYlp
hiqQMS3kJEVEhLDcmiXDjSNQZMT2vyUD/wPSEEccqjWV0DRZP4xT1cUxnZAV2vzz
p4oYrVwmOUQ9atQRsGcnsUINJJWvTDuS3+MbMKODDfDCwkpFaNCXtvujGzx+XyPs
tgJTs5seH/rRXQ7S/g57pr+nYAXTkXAj0yZtunWIAjlnmQCliVix5WL8/y3AjXBm
VdZOcHRnzOrKPhjKnJKhoUozPcWfMcMGbjT9vXLoadtLnDhZjCY2mBABkZ/gg5NU
YC43oeaV+DR/mYo7It2YwhzQYPPSxK9/ScIawLmQX1lZ8Y5Eoe8AuDqAzV4D+mym
5b/Dgj1doIerZi3SgWcMfkzaD+X5SpDhTCPvyzwY98jHPcOe6EDpKliVPWn8zmuc
IuGGI656TPGgOkS8quRcD8e3HF9tySROV3y8zOUlWhEKllC4oxt/iuyp6LtX31xu
SwSnHhGMF4B3hq+7K2ZYhgT4ifgMOYhC7m7XeVxJeDJTIUscHpTyh2njd3vPIpi4
A6ScnWi3GeYPFC8w/xelNGvrZOIuk9Wq/W5EAld5V/7okZYv/tx5lbNOgE9/DJhe
yOM3WBq3qv5AZZ9GSpkbv9L6b1pkXG/1ls8DsmQyd3r6mfEQakY=
=3WVv
-----END PGP SIGNATURE-----

--=-fDUHnu0CzJPVFGHGpzCE--


.


Author: Tony V E <tvaneerd@gmail.com>
Date: Tue, 20 Mar 2018 18:14:42 -0400
Raw View
--000000000000c5b7c80567df660e
Content-Type: text/plain; charset="UTF-8"

On Tue, Mar 20, 2018 at 7:06 AM, Dejan Milosavljevic <dmilos@gmail.com>
wrote:

> > This language feature is called Concepts, and is already in the working
> draft for C++20
>
> Concept allows you to make constraints on not (yet) exiting types.
> This make specialization on existing types.
>
>
True, but do we need both? (Or all three, really).

We can currently specialize a single type.
With Concepts we can "specialize" a category of types.
With yours we can specialize a list of types.

Is it worth it?



>
> On Tue, Mar 20, 2018 at 11:52 AM, Barry Revzin <barry.revzin@gmail.com>
> wrote:
>
>>
>>
>> On Tuesday, March 20, 2018 at 9:20:40 AM UTC, Dejan Milosavljevic wrote:
>>>
>>> Hello
>>>
>>>   Here is simple idea how to use existing code to make several (partial)
>>> specialization at once.
>>>
>>
>>
>> These are explicit specializations.
>>
>>
>>
>>>   Instead of one type use list of types.
>>>
>>>   Quick example:
>>>
>>> template< typename T > //Primary template as we know
>>>   class A {
>>>      void print(){ std::cout << "Primary template" << std::endl; }
>>>    };
>>> template<>
>>>   class A< { char*, std::string, std::wstring } > { // Instead one type
>>> it is list of types.
>>>      void print(){ std::cout << "String  specialization" << std::endl; }
>>>    };
>>>
>>>
>>> More details/examples in attachment.
>>> Source controlled file: https://github.com/dmilo
>>> s/cpp_proposal/blob/master/multi_spec.html
>>>
>>> D.
>>>
>>>
>>
>> What do you think instead of a syntax which allows you to make a partial
>> class template specialization based on constraining the template parameter?
>>
>> template <typename T>
>> class A { ... };
>>
>> template <typename T, typename... Us>
>> inline constexpr bool is_any_of_v = (std::is_same_v<T, Us> || ... );
>>
>> template <typename T>
>>     requires is_any_of_v<T, char*, std::string, std::wstring>
>> class A<T> { ... };
>>
>>  Or even:
>>
>> template <typename T>
>> concept StringLike = /* something sane */;
>>
>> template <StringLike T>
>> class A<T> { ... };
>>
>> This language feature is called Concepts, and is already in the working
>> draft for C++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.
>> To view this discussion on the web visit https://groups.google.com/a/is
>> ocpp.org/d/msgid/std-proposals/90cc934f-8532-4110-8d73-
>> 2824dabd51ec%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/90cc934f-8532-4110-8d73-2824dabd51ec%40isocpp.org?utm_medium=email&utm_source=footer>
>> .
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/CAEfefmy8ApLMd3Ano1jowNWZoqqte
> ass%2BxAP2a4wjR7uhUvFuw%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAEfefmy8ApLMd3Ano1jowNWZoqqteass%2BxAP2a4wjR7uhUvFuw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>



--
Be seeing you,
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOHCbisLx5yrHkgvrKhJcurzH048ih3Dj363%3DORr3JrDc6zhFQ%40mail.gmail.com.

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

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Tue, Mar 20, 2018 at 7:06 AM, Dejan Milosavljevic <span dir=3D"ltr">=
&lt;<a href=3D"mailto:dmilos@gmail.com" target=3D"_blank">dmilos@gmail.com<=
/a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:=
0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><s=
pan class=3D""><div><span style=3D"text-align:left;color:rgb(34,34,34);text=
-transform:none;text-indent:0px;letter-spacing:normal;font-family:arial,san=
s-serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:=
400;text-decoration:none;word-spacing:0px;display:inline;white-space:normal=
;direction:ltr;float:none;background-color:transparent">&gt; This language =
feature is called Concepts, and is already in the working draft for C++20</=
span></div><div><span style=3D"text-align:left;color:rgb(34,34,34);text-tra=
nsform:none;text-indent:0px;letter-spacing:normal;font-family:arial,sans-se=
rif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:400;=
text-decoration:none;word-spacing:0px;display:inline;white-space:normal;dir=
ection:ltr;float:none;background-color:transparent"><br></span></div></span=
><div><span style=3D"text-align:left;color:rgb(34,34,34);text-transform:non=
e;text-indent:0px;letter-spacing:normal;font-family:arial,sans-serif;font-s=
ize:12.8px;font-style:normal;font-variant:normal;font-weight:400;text-decor=
ation:none;word-spacing:0px;display:inline;white-space:normal;direction:ltr=
;float:none;background-color:transparent">Concept allows you to make constr=
aints on not (yet) exiting types.</span></div><div><span style=3D"text-alig=
n:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spaci=
ng:normal;font-family:arial,sans-serif;font-size:12.8px;font-style:normal;f=
ont-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;di=
splay:inline;white-space:normal;direction:ltr;float:none;background-color:t=
ransparent">This make specialization on existing types.</span><span style=
=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px=
;letter-spacing:normal;font-family:arial,sans-serif;font-size:12.8px;font-s=
tyle:normal;font-variant:normal;font-weight:400;text-decoration:none;word-s=
pacing:0px;display:inline;white-space:normal;direction:ltr;float:none;backg=
round-color:transparent"></span></div><div><span style=3D"text-align:left;c=
olor:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:norma=
l;font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-vari=
ant:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:in=
line;white-space:normal;direction:ltr;float:none;background-color:transpare=
nt"><br></span></div></div></blockquote><div><br></div><div>True, but do we=
 need both? (Or all three, really).<br><br></div><div>We can currently spec=
ialize a single type.<br></div><div>With Concepts we can &quot;specialize&q=
uot; a category of types.<br></div><div>With yours we can specialize a list=
 of types.<br><br></div><div>Is it worth it?<br><br><br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"ltr"><div><span style=3D"text-align:left;colo=
r:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;f=
ont-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant=
:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inlin=
e;white-space:normal;direction:ltr;float:none;background-color:transparent"=
></span></div><div><span style=3D"text-align:left;color:rgb(34,34,34);text-=
transform:none;text-indent:0px;letter-spacing:normal;font-family:arial,sans=
-serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:4=
00;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;=
direction:ltr;float:none;background-color:transparent"><br></span></div></d=
iv><div><div class=3D"h5"><div class=3D"gmail_extra"><br><div class=3D"gmai=
l_quote">On Tue, Mar 20, 2018 at 11:52 AM, Barry Revzin <span dir=3D"ltr">&=
lt;<a href=3D"mailto:barry.revzin@gmail.com" target=3D"_blank">barry.revzin=
@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr"><span><br><br>On Tuesday, March 20, 2018 at 9:20:40 AM UTC, Dejan =
Milosavljevic wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;mar=
gin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
"><div>Hello</div><div><br></div><div>=C2=A0 Here is simple idea how to use=
 existing code to make several (partial) specialization at once.</div></div=
></blockquote><div>=C2=A0</div><div><br></div></span><div>These are explici=
t specializations.</div><span><div><br></div><div>=C2=A0</div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr"><div>=C2=A0 Instead of one type=
 use list of types.</div><div><br></div><div>=C2=A0 Quick example:</div><bl=
ockquote style=3D"margin-right:0px" dir=3D"ltr"><div><font face=3D"courier =
new,monospace">template&lt; typename T &gt; //Primary template as we know<b=
r>=C2=A0 class A {<br>=C2=A0=C2=A0=C2=A0=C2=A0 void print(){ std::cout &lt;=
&lt; &quot;Primary template&quot; &lt;&lt; std::endl; }<br>=C2=A0=C2=A0 };<=
/font></div><div><font face=3D"courier new,monospace">template&lt;&gt;<br>=
=C2=A0 class A&lt; { char*, std::string, std::wstring } &gt; { // Instead o=
ne type it is list of types.<br>=C2=A0=C2=A0=C2=A0=C2=A0 void print(){ std:=
:cout &lt;&lt; &quot;String=C2=A0 specialization&quot; &lt;&lt; std::endl; =
}<br>=C2=A0=C2=A0 };</font></div><div><b><font face=3D"courier new,monospac=
e"><br></font></b></div></blockquote><div><br></div><div>More details/examp=
les in attachment.</div><div>Source controlled file:=C2=A0<a href=3D"https:=
//github.com/dmilos/cpp_proposal/blob/master/multi_spec.html" rel=3D"nofoll=
ow" target=3D"_blank">https://github.com/dmilo<wbr>s/cpp_proposal/blob/mast=
er/mul<wbr>ti_spec.html</a></div><div><br></div><div>D.</div><div>=C2=A0</d=
iv></div></blockquote><div><br></div></span><div>What do you think instead =
of a syntax which allows you to make a partial class template specializatio=
n based on constraining the template parameter?=C2=A0</div><div><br></div><=
div><div class=3D"m_-1436233867860257749m_485155225628945315prettyprint" st=
yle=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);bord=
er-style:solid;border-width:1px;word-wrap:break-word"><code class=3D"m_-143=
6233867860257749m_485155225628945315prettyprint"><div class=3D"m_-143623386=
7860257749m_485155225628945315subprettyprint"><span class=3D"m_-14362338678=
60257749m_485155225628945315styled-by-prettify" style=3D"color:#008">templa=
te</span><span class=3D"m_-1436233867860257749m_485155225628945315styled-by=
-prettify" style=3D"color:#000"> </span><span class=3D"m_-14362338678602577=
49m_485155225628945315styled-by-prettify" style=3D"color:#660">&lt;</span><=
span class=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify"=
 style=3D"color:#008">typename</span><span class=3D"m_-1436233867860257749m=
_485155225628945315styled-by-prettify" style=3D"color:#000"> T</span><span =
class=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" styl=
e=3D"color:#660">&gt;</span><span class=3D"m_-1436233867860257749m_48515522=
5628945315styled-by-prettify" style=3D"color:#000"><br></span><span class=
=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=3D"=
color:#008">class</span><span class=3D"m_-1436233867860257749m_485155225628=
945315styled-by-prettify" style=3D"color:#000"> A </span><span class=3D"m_-=
1436233867860257749m_485155225628945315styled-by-prettify" style=3D"color:#=
660">{</span><span class=3D"m_-1436233867860257749m_485155225628945315style=
d-by-prettify" style=3D"color:#000"> </span><span class=3D"m_-1436233867860=
257749m_485155225628945315styled-by-prettify" style=3D"color:#660">...</spa=
n><span class=3D"m_-1436233867860257749m_485155225628945315styled-by-pretti=
fy" style=3D"color:#000"> </span><span class=3D"m_-1436233867860257749m_485=
155225628945315styled-by-prettify" style=3D"color:#660">};</span><span clas=
s=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=3D=
"color:#000"><br><br></span><span class=3D"m_-1436233867860257749m_48515522=
5628945315styled-by-prettify" style=3D"color:#008">template</span><span cla=
ss=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=
=3D"color:#000"> </span><span class=3D"m_-1436233867860257749m_485155225628=
945315styled-by-prettify" style=3D"color:#660">&lt;</span><font color=3D"#0=
00088"><span class=3D"m_-1436233867860257749m_485155225628945315styled-by-p=
rettify" style=3D"color:#008">typename</span><span class=3D"m_-143623386786=
0257749m_485155225628945315styled-by-prettify" style=3D"color:#000"> T</spa=
n><span class=3D"m_-1436233867860257749m_485155225628945315styled-by-pretti=
fy" style=3D"color:#660">,</span><span class=3D"m_-1436233867860257749m_485=
155225628945315styled-by-prettify" style=3D"color:#000"> </span><span class=
=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=3D"=
color:#008">typename</span><span class=3D"m_-1436233867860257749m_485155225=
628945315styled-by-prettify" style=3D"color:#660">...</span><span class=3D"=
m_-1436233867860257749m_485155225628945315styled-by-prettify" style=3D"colo=
r:#000"> </span><span class=3D"m_-1436233867860257749m_485155225628945315st=
yled-by-prettify" style=3D"color:#606">Us</span><span class=3D"m_-143623386=
7860257749m_485155225628945315styled-by-prettify" style=3D"color:#660">&gt;=
</span><span class=3D"m_-1436233867860257749m_485155225628945315styled-by-p=
rettify" style=3D"color:#000"><br></span></font><span class=3D"m_-143623386=
7860257749m_485155225628945315styled-by-prettify" style=3D"color:#008">inli=
ne</span><span class=3D"m_-1436233867860257749m_485155225628945315styled-by=
-prettify" style=3D"color:#000"> </span><span class=3D"m_-14362338678602577=
49m_485155225628945315styled-by-prettify" style=3D"color:#008">constexpr</s=
pan><span class=3D"m_-1436233867860257749m_485155225628945315styled-by-pret=
tify" style=3D"color:#000"> </span><span class=3D"m_-1436233867860257749m_4=
85155225628945315styled-by-prettify" style=3D"color:#008">bool</span><span =
class=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" styl=
e=3D"color:#000"> is_any_of_v </span><span class=3D"m_-1436233867860257749m=
_485155225628945315styled-by-prettify" style=3D"color:#660">=3D</span><span=
 class=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" sty=
le=3D"color:#000"> </span><span class=3D"m_-1436233867860257749m_4851552256=
28945315styled-by-prettify" style=3D"color:#660">(</span><span class=3D"m_-=
1436233867860257749m_485155225628945315styled-by-prettify" style=3D"color:#=
000">std</span><span class=3D"m_-1436233867860257749m_485155225628945315sty=
led-by-prettify" style=3D"color:#660">::</span><span class=3D"m_-1436233867=
860257749m_485155225628945315styled-by-prettify" style=3D"color:#000">is_sa=
me_v</span><span class=3D"m_-1436233867860257749m_485155225628945315styled-=
by-prettify" style=3D"color:#660">&lt;</span><span class=3D"m_-143623386786=
0257749m_485155225628945315styled-by-prettify" style=3D"color:#000">T</span=
><span class=3D"m_-1436233867860257749m_485155225628945315styled-by-prettif=
y" style=3D"color:#660">,</span><span class=3D"m_-1436233867860257749m_4851=
55225628945315styled-by-prettify" style=3D"color:#000"> </span><span class=
=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=3D"=
color:#606">Us</span><span class=3D"m_-1436233867860257749m_485155225628945=
315styled-by-prettify" style=3D"color:#660">&gt;</span><span class=3D"m_-14=
36233867860257749m_485155225628945315styled-by-prettify" style=3D"color:#00=
0"> </span><span class=3D"m_-1436233867860257749m_485155225628945315styled-=
by-prettify" style=3D"color:#660">||</span><span class=3D"m_-14362338678602=
57749m_485155225628945315styled-by-prettify" style=3D"color:#000"> </span><=
span class=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify"=
 style=3D"color:#660">..</span><font color=3D"#000000"><span class=3D"m_-14=
36233867860257749m_485155225628945315styled-by-prettify" style=3D"color:#66=
0">.</span><span class=3D"m_-1436233867860257749m_485155225628945315styled-=
by-prettify" style=3D"color:#000"> </span><span class=3D"m_-143623386786025=
7749m_485155225628945315styled-by-prettify" style=3D"color:#660">);</span><=
/font><span class=3D"m_-1436233867860257749m_485155225628945315styled-by-pr=
ettify" style=3D"color:#000"><br><br></span><span class=3D"m_-1436233867860=
257749m_485155225628945315styled-by-prettify" style=3D"color:#008">template=
</span><span class=3D"m_-1436233867860257749m_485155225628945315styled-by-p=
rettify" style=3D"color:#000"> </span><span class=3D"m_-1436233867860257749=
m_485155225628945315styled-by-prettify" style=3D"color:#660">&lt;</span><sp=
an class=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" s=
tyle=3D"color:#008">typename</span><span class=3D"m_-1436233867860257749m_4=
85155225628945315styled-by-prettify" style=3D"color:#000"> T</span><span cl=
ass=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=
=3D"color:#660">&gt;</span><span class=3D"m_-1436233867860257749m_485155225=
628945315styled-by-prettify" style=3D"color:#000"><br>=C2=A0 =C2=A0 require=
s is_any_of_v</span><span class=3D"m_-1436233867860257749m_4851552256289453=
15styled-by-prettify" style=3D"color:#660">&lt;</span><span class=3D"m_-143=
6233867860257749m_485155225628945315styled-by-prettify" style=3D"color:#000=
">T</span><span class=3D"m_-1436233867860257749m_485155225628945315styled-b=
y-prettify" style=3D"color:#660">,</span><span class=3D"m_-1436233867860257=
749m_485155225628945315styled-by-prettify" style=3D"color:#000"> </span><sp=
an class=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" s=
tyle=3D"color:#008">char</span><span class=3D"m_-1436233867860257749m_48515=
5225628945315styled-by-prettify" style=3D"color:#660">*,</span><span class=
=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=3D"=
color:#000"> std</span><span class=3D"m_-1436233867860257749m_4851552256289=
45315styled-by-prettify" style=3D"color:#660">::</span><span class=3D"m_-14=
36233867860257749m_485155225628945315styled-by-prettify" style=3D"color:#00=
8">string</span><span class=3D"m_-1436233867860257749m_485155225628945315st=
yled-by-prettify" style=3D"color:#660">,</span><span class=3D"m_-1436233867=
860257749m_485155225628945315styled-by-prettify" style=3D"color:#000"> std<=
/span><span class=3D"m_-1436233867860257749m_485155225628945315styled-by-pr=
ettify" style=3D"color:#660">::</span><span class=3D"m_-1436233867860257749=
m_485155225628945315styled-by-prettify" style=3D"color:#000">wstring</span>=
<span class=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify=
" style=3D"color:#660">&gt;</span><span class=3D"m_-1436233867860257749m_48=
5155225628945315styled-by-prettify" style=3D"color:#000"><br></span><span c=
lass=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=
=3D"color:#008">class</span><span class=3D"m_-1436233867860257749m_48515522=
5628945315styled-by-prettify" style=3D"color:#000"> A</span><span class=3D"=
m_-1436233867860257749m_485155225628945315styled-by-prettify" style=3D"colo=
r:#660">&lt;</span><span class=3D"m_-1436233867860257749m_48515522562894531=
5styled-by-prettify" style=3D"color:#000">T</span><span class=3D"m_-1436233=
867860257749m_485155225628945315styled-by-prettify" style=3D"color:#660">&g=
t;</span><span class=3D"m_-1436233867860257749m_485155225628945315styled-by=
-prettify" style=3D"color:#000"> </span><span class=3D"m_-14362338678602577=
49m_485155225628945315styled-by-prettify" style=3D"color:#660">{</span><spa=
n class=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" st=
yle=3D"color:#000"> </span><span class=3D"m_-1436233867860257749m_485155225=
628945315styled-by-prettify" style=3D"color:#660">...</span><span class=3D"=
m_-1436233867860257749m_485155225628945315styled-by-prettify" style=3D"colo=
r:#000"> </span><span class=3D"m_-1436233867860257749m_485155225628945315st=
yled-by-prettify" style=3D"color:#660">};</span></div></code></div><br>=C2=
=A0Or even:</div><div><br></div><div><div class=3D"m_-1436233867860257749m_=
485155225628945315prettyprint" style=3D"background-color:rgb(250,250,250);b=
order-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:=
break-word"><code class=3D"m_-1436233867860257749m_485155225628945315pretty=
print"><div class=3D"m_-1436233867860257749m_485155225628945315subprettypri=
nt"><font color=3D"#660066"><span class=3D"m_-1436233867860257749m_48515522=
5628945315styled-by-prettify" style=3D"color:#008">template</span><span cla=
ss=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=
=3D"color:#000"> </span><span class=3D"m_-1436233867860257749m_485155225628=
945315styled-by-prettify" style=3D"color:#660">&lt;</span><span class=3D"m_=
-1436233867860257749m_485155225628945315styled-by-prettify" style=3D"color:=
#008">typename</span><span class=3D"m_-1436233867860257749m_485155225628945=
315styled-by-prettify" style=3D"color:#000"> T</span><span class=3D"m_-1436=
233867860257749m_485155225628945315styled-by-prettify" style=3D"color:#660"=
>&gt;</span><span class=3D"m_-1436233867860257749m_485155225628945315styled=
-by-prettify" style=3D"color:#000"><br></span><span class=3D"m_-14362338678=
60257749m_485155225628945315styled-by-prettify" style=3D"color:#008">concep=
t</span><span class=3D"m_-1436233867860257749m_485155225628945315styled-by-=
prettify" style=3D"color:#000"> </span><span class=3D"m_-143623386786025774=
9m_485155225628945315styled-by-prettify" style=3D"color:#606">StringLike</s=
pan><span class=3D"m_-1436233867860257749m_485155225628945315styled-by-pret=
tify" style=3D"color:#000"> </span><span class=3D"m_-1436233867860257749m_4=
85155225628945315styled-by-prettify" style=3D"color:#660">=3D</span><span c=
lass=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=
=3D"color:#000"> </span><span class=3D"m_-1436233867860257749m_485155225628=
945315styled-by-prettify" style=3D"color:#800">/* something sane */</span><=
span class=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify"=
 style=3D"color:#660">;</span><span class=3D"m_-1436233867860257749m_485155=
225628945315styled-by-prettify" style=3D"color:#000"><br><br></span><span c=
lass=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=
=3D"color:#008">template</span><span class=3D"m_-1436233867860257749m_48515=
5225628945315styled-by-prettify" style=3D"color:#000"> </span><span class=
=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=3D"=
color:#660">&lt;</span><span class=3D"m_-1436233867860257749m_4851552256289=
45315styled-by-prettify" style=3D"color:#606">StringLike</span><span class=
=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=3D"=
color:#000"> T</span><span class=3D"m_-1436233867860257749m_485155225628945=
315styled-by-prettify" style=3D"color:#660">&gt;</span><span class=3D"m_-14=
36233867860257749m_485155225628945315styled-by-prettify" style=3D"color:#00=
0"><br></span><span class=3D"m_-1436233867860257749m_485155225628945315styl=
ed-by-prettify" style=3D"color:#008">class</span><span class=3D"m_-14362338=
67860257749m_485155225628945315styled-by-prettify" style=3D"color:#000"> A<=
/span><span class=3D"m_-1436233867860257749m_485155225628945315styled-by-pr=
ettify" style=3D"color:#660">&lt;</span><span class=3D"m_-14362338678602577=
49m_485155225628945315styled-by-prettify" style=3D"color:#000">T</span><spa=
n class=3D"m_-1436233867860257749m_485155225628945315styled-by-prettify" st=
yle=3D"color:#660">&gt;</span><span class=3D"m_-1436233867860257749m_485155=
225628945315styled-by-prettify" style=3D"color:#000"> </span><span class=3D=
"m_-1436233867860257749m_485155225628945315styled-by-prettify" style=3D"col=
or:#660">{</span><span class=3D"m_-1436233867860257749m_485155225628945315s=
tyled-by-prettify" style=3D"color:#000"> </span><span class=3D"m_-143623386=
7860257749m_485155225628945315styled-by-prettify" style=3D"color:#660">...<=
/span><span class=3D"m_-1436233867860257749m_485155225628945315styled-by-pr=
ettify" style=3D"color:#000"> </span><span class=3D"m_-1436233867860257749m=
_485155225628945315styled-by-prettify" style=3D"color:#660">};</span></font=
></div></code></div><div><br></div>This language feature is called Concepts=
, and is already in the working draft for C++20.</div><div><br></div></div>=
<span>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isoc<wbr>pp.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></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/90cc934f-8532-4110-8d73-2824dabd51ec%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/is<wbr>ocpp.org/d/msgid/std-proposals<wbr>/90cc=
934f-8532-4110-8d73-<wbr>2824dabd51ec%40isocpp.org</a>.<br>
</blockquote></div><br></div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></div></div>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAEfefmy8ApLMd3Ano1jowNWZoqqteass%2Bx=
AP2a4wjR7uhUvFuw%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfoote=
r" target=3D"_blank">https://groups.google.com/a/<wbr>isocpp.org/d/msgid/st=
d-<wbr>proposals/<wbr>CAEfefmy8ApLMd3Ano1jowNWZoqqte<wbr>ass%2BxAP2a4wjR7uh=
UvFuw%<wbr>40mail.gmail.com</a>.<br>
</blockquote></div><br><br clear=3D"all"><br>-- <br><div class=3D"gmail_sig=
nature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div>Be seeing =
you,<br></div>Tony<br></div></div>
</div></div>

<p></p>

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

--000000000000c5b7c80567df660e--

.


Author: Alberto Barbati <albertobarbati@gmail.com>
Date: Wed, 21 Mar 2018 00:55:38 -0700 (PDT)
Raw View
------=_Part_1150_1297938294.1521618938932
Content-Type: multipart/alternative;
 boundary="----=_Part_1151_364448584.1521618938932"

------=_Part_1151_364448584.1521618938932
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Il giorno marted=C3=AC 20 marzo 2018 12:06:41 UTC+1, Dejan Milosavljevic ha=
=20
scritto:
>
> > This language feature is called Concepts, and is already in the working=
=20
> draft for C++20
>
> Concept allows you to make constraints on not (yet) exiting types.
> This make specialization on existing types.
>

Concepts can do both things, as Barry clearly showed that they *can *specia=
lize=20
on existing types using the is_any_of_v technique. While your idea is=20
interesting, we already have a much superior feature already voted in=20
C++20, so I'm afraid we don't need yours.

A.

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/66132261-3dde-49ec-a62c-ac4330815621%40isocpp.or=
g.

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

<div dir=3D"ltr">Il giorno marted=C3=AC 20 marzo 2018 12:06:41 UTC+1, Dejan=
 Milosavljevic ha scritto:<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"><div><span style=3D"text-align:left;color:rgb(34,34,34);text-t=
ransform:none;text-indent:0px;letter-spacing:normal;font-family:arial,sans-=
serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:40=
0;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;d=
irection:ltr;float:none;background-color:transparent">&gt; This language fe=
ature is called Concepts, and is already in the working draft for C++20</sp=
an></div><div><span style=3D"text-align:left;color:rgb(34,34,34);text-trans=
form:none;text-indent:0px;letter-spacing:normal;font-family:arial,sans-seri=
f;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:400;te=
xt-decoration:none;word-spacing:0px;display:inline;white-space:normal;direc=
tion:ltr;float:none;background-color:transparent"><br></span></div><div><sp=
an style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-in=
dent:0px;letter-spacing:normal;font-family:arial,sans-serif;font-size:12.8p=
x;font-style:normal;font-variant:normal;font-weight:400;text-decoration:non=
e;word-spacing:0px;display:inline;white-space:normal;direction:ltr;float:no=
ne;background-color:transparent">Concept allows you to make constraints on =
not (yet) exiting types.</span></div><div><span style=3D"text-align:left;co=
lor:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal=
;font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-varia=
nt:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inl=
ine;white-space:normal;direction:ltr;float:none;background-color:transparen=
t">This make specialization on existing types.</span><span style=3D"text-al=
ign:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spa=
cing:normal;font-family:arial,sans-serif;font-size:12.8px;font-style:normal=
;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;=
display:inline;white-space:normal;direction:ltr;float:none;background-color=
:transparent"></span></div></div></blockquote><div><br>Concepts can do both=
 things, as Barry clearly showed that they <b>can </b>specialize on existin=
g types using the <code><span style=3D"color:#000">is_any_of_v <span style=
=3D"font-family: arial, sans-serif;">technique. While your idea is interest=
ing, we already have a much superior feature already voted in C++20, so I&#=
39;m afraid we don&#39;t need yours.<br><br>A.<br></span></span></code></di=
v></div>

<p></p>

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

------=_Part_1151_364448584.1521618938932--

------=_Part_1150_1297938294.1521618938932--

.


Author: Dejan Milosavljevic <dmilos@gmail.com>
Date: Wed, 21 Mar 2018 09:55:51 +0100
Raw View
--94eb2c1cd306b833d50567e85b49
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

No doubt that this problem can be solved within standard.
Document present tree solution within standard.
In here there are another two.

Main question what is the cost/effort of that?

For concepts there is need for concept which require pile of code to
write/read/maintain.
Second example also add descent amount of code too and for the first read
can be confusing for understanding.
Mainly we want to read code just once line by line, without scrolling
up/down to see more code to understand our current focus.

This proposal shrink this to minimal.
One line to write. One line to read. One line to maintain.


On Wed, Mar 21, 2018 at 8:55 AM, Alberto Barbati <albertobarbati@gmail.com>
wrote:

> Il giorno marted=C3=AC 20 marzo 2018 12:06:41 UTC+1, Dejan Milosavljevic =
ha
> scritto:
>>
>> > This language feature is called Concepts, and is already in the workin=
g
>> draft for C++20
>>
>> Concept allows you to make constraints on not (yet) exiting types.
>> This make specialization on existing types.
>>
>
> Concepts can do both things, as Barry clearly showed that they *can *spec=
ialize
> on existing types using the is_any_of_v technique. While your idea is
> interesting, we already have a much superior feature already voted in
> C++20, so I'm afraid we don't need yours.
>
> A.
>
> --
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/66132261-3dde-49ec-
> a62c-ac4330815621%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/66132261-3d=
de-49ec-a62c-ac4330815621%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAEfefmwo8c5BLo%3Din423r%2B4WYzr6Ubc%2BU9B5AsjP_=
7p3gNJzbA%40mail.gmail.com.

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

<div dir=3D"ltr"><div>No doubt that this problem can be solved within stand=
ard.<br>Document present tree solution within standard.</div><div>In here t=
here are another two.</div><div><br></div><div>Main question what is the co=
st/effort of that?</div><div><br></div><div>For concepts there is need for =
concept which require pile of code to write/read/maintain. <br>Second examp=
le also add descent amount of code too and for the first read can be confus=
ing for understanding.<br>Mainly we want to read code just once line by lin=
e, without scrolling up/down to see more code to understand our current foc=
us.</div><div><br></div><div>This proposal shrink this to minimal. </div><d=
iv>One line to write. One line to read. One line to maintain.</div><div><br=
></div><div></div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_=
quote">On Wed, Mar 21, 2018 at 8:55 AM, Alberto Barbati <span dir=3D"ltr">&=
lt;<a href=3D"mailto:albertobarbati@gmail.com" target=3D"_blank">albertobar=
bati@gmail.com</a>&gt;</span> wrote:<br><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"><span>Il giorno marted=C3=AC 20 marzo 2018 12:06:41 UTC+1, Dej=
an Milosavljevic ha scritto:<blockquote class=3D"gmail_quote" style=3D"marg=
in:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div di=
r=3D"ltr"><div><span style=3D"text-align:left;color:rgb(34,34,34);text-tran=
sform:none;text-indent:0px;letter-spacing:normal;font-family:arial,sans-ser=
if;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:400;t=
ext-decoration:none;word-spacing:0px;display:inline;white-space:normal;dire=
ction:ltr;float:none;background-color:transparent">&gt; This language featu=
re is called Concepts, and is already in the working draft for C++20</span>=
</div><div><span style=3D"text-align:left;color:rgb(34,34,34);text-transfor=
m:none;text-indent:0px;letter-spacing:normal;font-family:arial,sans-serif;f=
ont-size:12.8px;font-style:normal;font-variant:normal;font-weight:400;text-=
decoration:none;word-spacing:0px;display:inline;white-space:normal;directio=
n:ltr;float:none;background-color:transparent"><br></span></div><div><span =
style=3D"text-align:left;color:rgb(34,34,34);text-transform:none;text-inden=
t:0px;letter-spacing:normal;font-family:arial,sans-serif;font-size:12.8px;f=
ont-style:normal;font-variant:normal;font-weight:400;text-decoration:none;w=
ord-spacing:0px;display:inline;white-space:normal;direction:ltr;float:none;=
background-color:transparent">Concept allows you to make constraints on not=
 (yet) exiting types.</span></div><div><span style=3D"text-align:left;color=
:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;fo=
nt-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant:=
normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline=
;white-space:normal;direction:ltr;float:none;background-color:transparent">=
This make specialization on existing types.</span><span style=3D"text-align=
:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacin=
g:normal;font-family:arial,sans-serif;font-size:12.8px;font-style:normal;fo=
nt-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;dis=
play:inline;white-space:normal;direction:ltr;float:none;background-color:tr=
ansparent"></span></div></div></blockquote></span><div><br>Concepts can do =
both things, as Barry clearly showed that they <b>can </b>specialize on exi=
sting types using the <code><span style=3D"color:#000">is_any_of_v <span st=
yle=3D"font-family:arial,sans-serif">technique. While your idea is interest=
ing, we already have a much superior feature already voted in C++20, so I&#=
39;m afraid we don&#39;t need yours.<br><br>A.<br></span></span></code></di=
v></div><span>

<p></p>

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

<p></p>

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

--94eb2c1cd306b833d50567e85b49--

.


Author: Alberto Barbati <albertobarbati@gmail.com>
Date: Wed, 21 Mar 2018 02:16:13 -0700 (PDT)
Raw View
------=_Part_13453_381423121.1521623773811
Content-Type: multipart/alternative;
 boundary="----=_Part_13454_977811991.1521623773811"

------=_Part_13454_977811991.1521623773811
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Il giorno mercoled=C3=AC 21 marzo 2018 09:55:54 UTC+1, Dejan Milosavljevic =
ha=20
scritto:
>
> For concepts there is need for concept which require pile of code to=20
> write/read/maintain.=20
>

What? As long as the standard library includes a facility like is_any_of_v=
=20
(and I'm sure that's going to happen), you don't need to write more than=20
one extra line. I don't see a big difference between

template <typename T>
    requires is_any_of_v<T, char*, std::string, std::wstring>
class A<T> { ... };

and

template<>
class A< { char*, std::string, std::wstring } > { ... };

in terms of maintainability.
=20

> Second example also add descent amount of code too and for the first read=
=20
> can be confusing for understanding.
>

What second example? Please be more specific.
=20

> Mainly we want to read code just once line by line, without scrolling=20
> up/down to see more code to understand our current focus.
>
> This proposal shrink this to minimal.=20
> One line to write. One line to read. One line to maintain.
>

One more feature to learn, that is useful only in this specific case.

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/d1f5be50-77f6-45cc-875a-d084d55e8b60%40isocpp.or=
g.

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

<div dir=3D"ltr">Il giorno mercoled=C3=AC 21 marzo 2018 09:55:54 UTC+1, Dej=
an Milosavljevic ha scritto:<blockquote class=3D"gmail_quote" style=3D"marg=
in: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><d=
iv dir=3D"ltr"><div>For concepts there is need for concept which require pi=
le of code to write/read/maintain. <br></div></div></blockquote><div><br>Wh=
at? As long as the standard library includes a facility like is_any_of_v (a=
nd I&#39;m sure that&#39;s going to happen), you don&#39;t need to write mo=
re than one extra line. I don&#39;t see a big difference between<br><br>tem=
plate &lt;typename T&gt;<br>=C2=A0=C2=A0=C2=A0 requires is_any_of_v&lt;T, c=
har*, std::string, std::wstring&gt;<br>class A&lt;T&gt; { ... };<br><br>and=
<br><br>template&lt;&gt;<br>class A&lt; { char*, std::string, std::wstring =
} &gt; { ... };<br><br>in terms of maintainability.<br>=C2=A0<br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-=
left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>Second examp=
le also add descent amount of code too and for the first read can be confus=
ing for understanding.<br></div></div></blockquote><div><br>What second exa=
mple? Please be more specific.<br>=C2=A0<br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;=
padding-left: 1ex;"><div dir=3D"ltr"><div>Mainly we want to read code just =
once line by line, without scrolling up/down to see more code to understand=
 our current focus.</div><div><br></div><div>This proposal shrink this to m=
inimal. </div><div>One line to write. One line to read. One line to maintai=
n.</div></div></blockquote><div><br>One more feature to learn, that is usef=
ul only in this specific case.<br></div></div>

<p></p>

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

------=_Part_13454_977811991.1521623773811--

------=_Part_13453_381423121.1521623773811--

.


Author: Richard Smith <richard@metafoo.co.uk>
Date: Wed, 21 Mar 2018 12:25:53 -0700
Raw View
--f4f5e808fb480ace510567f12a63
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On 21 March 2018 at 02:16, Alberto Barbati <albertobarbati@gmail.com> wrote=
:

> Il giorno mercoled=C3=AC 21 marzo 2018 09:55:54 UTC+1, Dejan Milosavljevi=
c ha
> scritto:
>>
>> For concepts there is need for concept which require pile of code to
>> write/read/maintain.
>>
>
> What? As long as the standard library includes a facility like is_any_of_=
v
> (and I'm sure that's going to happen), you don't need to write more than
> one extra line. I don't see a big difference between
>
> template <typename T>
>     requires is_any_of_v<T, char*, std::string, std::wstring>
> class A<T> { ... };
>
> and
>
> template<>
> class A< { char*, std::string, std::wstring } > { ... };
>
> in terms of maintainability.
>

FWIW, the relevant concept is completely trivial.

  template<typename T, typename ...U> concept AnyOf =3D (std::is_same_v<T,U=
>
|| ...);

  template<AnyOf<char*, std::string, std::wstring> T>
  class A<T> { ... };

This appears to be strictly better than the A<{...}> approach, as it
provides a natural way to give a name to the type (which you're almost
certainly going to need inside the specialization).

Second example also add descent amount of code too and for the first read
>> can be confusing for understanding.
>>
>
> What second example? Please be more specific.
>
>
>> Mainly we want to read code just once line by line, without scrolling
>> up/down to see more code to understand our current focus.
>>
>> This proposal shrink this to minimal.
>> One line to write. One line to read. One line to maintain.
>>
>
> One more feature to learn, that is useful only in this specific case.
>
> --
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/d1f5be50-77f6-45cc-
> 875a-d084d55e8b60%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/d1f5be50-77=
f6-45cc-875a-d084d55e8b60%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAOfiQqn_HNpwd9Px_7iTL-9qVOiU9%2BL7dBcp6YyD9VFUR=
d37%2BQ%40mail.gmail.com.

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

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On 2=
1 March 2018 at 02:16, Alberto Barbati <span dir=3D"ltr">&lt;<a href=3D"mai=
lto:albertobarbati@gmail.com" target=3D"_blank">albertobarbati@gmail.com</a=
>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 =
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><spa=
n class=3D"">Il giorno mercoled=C3=AC 21 marzo 2018 09:55:54 UTC+1, Dejan M=
ilosavljevic ha scritto:<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"><div>For concepts there is need for concept which require pile of cod=
e to write/read/maintain. <br></div></div></blockquote></span><div><br>What=
? As long as the standard library includes a facility like is_any_of_v (and=
 I&#39;m sure that&#39;s going to happen), you don&#39;t need to write more=
 than one extra line. I don&#39;t see a big difference between<span class=
=3D""><br><br>template &lt;typename T&gt;<br>=C2=A0=C2=A0=C2=A0 requires is=
_any_of_v&lt;T, char*, std::string, std::wstring&gt;<br>class A&lt;T&gt; { =
.... };<br><br></span>and<br><br>template&lt;&gt;<br>class A&lt; { char*, st=
d::string, std::wstring } &gt; { ... };<br><br>in terms of maintainability.=
<br></div></div></blockquote><div><br></div><div>FWIW, the relevant concept=
 is completely trivial.</div><div><br></div><div>=C2=A0 template&lt;typenam=
e T, typename ...U&gt; concept AnyOf =3D (std::is_same_v&lt;T,U&gt; || ...)=
;</div><div><br></div><div>=C2=A0 template&lt;AnyOf&lt;char*, std::string, =
std::wstring&gt; T&gt;</div><div>=C2=A0 class A&lt;T&gt; { ... };</div><div=
><br></div><div>This appears to be strictly better than the A&lt;{...}&gt; =
approach, as it provides a natural way to give a name to the type (which yo=
u&#39;re almost certainly going to need inside the specialization).</div><d=
iv><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div></div><sp=
an class=3D""><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-le=
ft:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div=
>Second example also add descent amount of code too and for the first read =
can be confusing for understanding.<br></div></div></blockquote></span><div=
><br>What second example? Please be more specific.<br>=C2=A0<br></div><span=
 class=3D""><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"><div>M=
ainly we want to read code just once line by line, without scrolling up/dow=
n to see more code to understand our current focus.</div><div><br></div><di=
v>This proposal shrink this to minimal. </div><div>One line to write. One l=
ine to read. One line to maintain.</div></div></blockquote></span><div><br>=
One more feature to learn, that is useful only in this specific case.<br></=
div></div><span class=3D"">

<p></p>

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

<p></p>

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

--f4f5e808fb480ace510567f12a63--

.