Topic: expression based deduction guides


Author: bastienpenava@gmail.com
Date: Tue, 10 Jul 2018 17:00:32 -0700 (PDT)
Raw View
------=_Part_3587_1773918286.1531267232166
Content-Type: multipart/alternative;
 boundary="----=_Part_3588_1446964829.1531267232168"

------=_Part_3588_1446964829.1531267232168
Content-Type: text/plain; charset="UTF-8"

Hi,

Deduction guides are great but could be even better if we were able to
better control the conversion and why not even produce custom conversions.
For instance if you wanted this work:

std::list<int> y { ... };
std::vector<int> x { y };

you could just write the following to make it work:

template<Container T>
std::vector(Container&& t) { return std::vector{t.begin(),  t.end()}; } //or
"= expr".The block would be as restrictive as c++11's constexpr functions

And if those expression where preparsed and injected instead of working
like normal function returns:

//Implementing lazy on the library side
template<class T>
struct Lazy : public T
{
    Lazy(T&& f) : T(std::forward<T>(f)) {}
    using T::operator();
};

template<class T>
Lazy(T&& x) { return Lazy{[&]{ return x; }}; } //no recursion, uses given
constructor as deduction guide

template<class T>
void func(Lazy<T> x)
{
     x();
     x();
}

int f()
{
   std::cout << "hello" << std::endl;
   return 0;
}

int main()
{
   func(f()); //func(Lazy{[&]{return f(); }});
}

//Implementing overload set as arguments by allowing unresolved types to be
passed to OverloadSet before error
template<class T>
struct OverloadSet : public T
{
 Lazy(T&& f) : T(std::forward<T>(f)) {}
 using T::operator();
};

template<class T>
OverloadSet(T&& x)
{
 return OverloadSet{
  []<class... Args>(Args&&... args)
     noexcept(noexcept(x(std::forward<Args...>(args)))
     -> decltype(x(std::forward<Args...>(args))
   {
     return x(std::forward<Args...>(args));
   }
 };
}

int f() { return 0; }
int f(int) { return 0; }

template<class T>
void func(T&& x)
{
 x(0);
 x();
}

int main()
{
 func(f); /* func(OverloadSet{[]<class... Args>(Args&&... args)
                noexcept(noexcept(x(std::forward<Args...>(args)))
                -> decltype(x(std::forward<Args...>(args))
             {
                return x(std::forward<Args...>(args));
             }); */
}

This would allow to have a real C++ alternative to long expression, type
conversions macros.
Just a thought, what do you think?
Anyway thanks for the read.

--
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/c0bed6aa-9fd9-42fe-9ad6-ab17b0c1d590%40isocpp.org.

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

<div dir=3D"ltr"><div>Hi,</div><div><br></div><div>Deduction guides are gre=
at but could be even better if we were able to better control the conversio=
n and why not even produce custom conversions.</div><div>For instance if yo=
u wanted this work:</div><div><br></div><div class=3D"prettyprint" style=3D=
"background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); bo=
rder-style: solid; border-width: 1px; word-wrap: break-word;"><code class=
=3D"prettyprint"><div class=3D"subprettyprint"><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: #000;" class=3D"styl=
ed-by-prettify">list</span><span style=3D"color: #080;" class=3D"styled-by-=
prettify">&lt;int&gt;</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> y </span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">...</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">};</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"><br>std</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify">vector</span><span style=3D"color: #080;" class=
=3D"styled-by-prettify">&lt;int&gt;</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> x </span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> y </span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">};</span></div></code></div><div><br></div><div>you could just write the =
following to make it work:</div><div><br></div><div class=3D"prettyprint" s=
tyle=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 1=
87); border-style: solid; border-width: 1px; word-wrap: break-word;"><code =
class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"color: #=
008;" class=3D"styled-by-prettify">template</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #606;" cl=
ass=3D"styled-by-prettify">Container</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> T</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br>std</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
>vector</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</=
span><span style=3D"color: #606;" class=3D"styled-by-prettify">Container</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">&amp;&amp;</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> t</span><spa=
n 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: #008;" class=3D"=
styled-by-prettify">return</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> std</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">vector</span><span style=3D"color: #660;" class=3D"styled-by-prettify">{<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify">t</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">begin</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">(),</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> =C2=A0t</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">.</span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">end</span><span style=3D"color: #660;" class=3D"sty=
led-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: #800;" class=3D"styled-by-prettify">//or &quot;=3D e=
xpr&quot;.The block would be as restrictive as c++11&#39;s constexpr functi=
ons</span></div></code></div><div><br></div><div>And if those expression wh=
ere preparsed and injected instead of working like normal function returns:=
</div><div><br></div><div class=3D"prettyprint" 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"><span style=3D"color: #800;" class=3D"styled-by-p=
rettify">//Implementing lazy on the library side</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #008=
;" class=3D"styled-by-prettify">template</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">class</span><span style=3D"color: #000;" class=3D"s=
tyled-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-prett=
ify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">s=
truct</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </sp=
an><span style=3D"color: #606;" class=3D"styled-by-prettify">Lazy</span><sp=
an 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: #008;" =
class=3D"styled-by-prettify">public</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> T<br></span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #606;" class=3D"=
styled-by-prettify">Lazy</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify">T</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&amp=
;&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> f</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span><spa=
n 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"> T</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: #000;" class=3D"styled-by-pret=
tify">forward</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">&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">f</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">))</span><span style=3D"co=
lor: #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"> =C2=A0 =C2=A0<br>=C2=A0 =C2=A0 </span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">using</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> T</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">::</span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">operator</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">();</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">};</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>template</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&=
lt;</span><span style=3D"color: #008;" class=3D"styled-by-prettify">class</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> T</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"=
color: #606;" class=3D"styled-by-prettify">Lazy</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify">T</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">&amp;&amp;</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> x</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> </span><font color=3D"#666600"><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">r=
eturn</span></font><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> </span><span style=3D"color: #606;" class=3D"styled-by-prettify">Lazy</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">{[&amp;]{</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #008;" class=3D"styled-by-prettify">return</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> x</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">}};</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #800;" class=3D"styled-by-prettify">//no recur=
sion, uses given constructor as deduction guide</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</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">class</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> T</span><span style=3D"color: #660;" class=3D"styl=
ed-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-pretti=
fy">void</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> f=
unc</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span=
><span style=3D"color: #606;" class=3D"styled-by-prettify">Lazy</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"> x</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br>=C2=A0 =C2=A0 =C2=A0x</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">();</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"><br>=C2=A0 =C2=A0 =C2=A0x</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">();</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"><br><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">=
int</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> f</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">()</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0std</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify">cout </span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">&lt;&lt;</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #080;" class=
=3D"styled-by-prettify">&quot;hello&quot;</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">&lt;&lt;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> std</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">endl</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0</span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">return</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #066;" class=3D"styled-by-prettify">0</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #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">int</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> main</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">()</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0func</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">f<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">());</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span sty=
le=3D"color: #800;" class=3D"styled-by-prettify">//func(Lazy{[&amp;]{return=
 f(); }});</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</spa=
n></div></code></div><div><br></div><div class=3D"prettyprint" style=3D"bac=
kground-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border=
-style: solid; border-width: 1px; word-wrap: break-word;"><code class=3D"pr=
ettyprint"><div class=3D"subprettyprint"><span style=3D"color: #800;" class=
=3D"styled-by-prettify">//Implementing overload set as arguments by allowin=
g unresolved types to be passed to OverloadSet before error</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">template</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">class</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"st=
yled-by-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">struct</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> </span><span style=3D"color: #606;" class=3D"styled-by-prettify">O=
verloadSet</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 styl=
e=3D"color: #008;" class=3D"styled-by-prettify">public</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> T<br></span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"><br>=C2=A0</span><span style=3D"color: #606;=
" class=3D"styled-by-prettify">Lazy</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">T</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">&amp;&amp;</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> f</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><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> T</span><span style=3D"colo=
r: #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: #000;" class=3D"styl=
ed-by-prettify">forward</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">T</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&g=
t;(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">f</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">))</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">{}</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> <br>=C2=A0</span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">using</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> T</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">::</span><span style=3D"color: #008;" class=3D"styl=
ed-by-prettify">operator</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">();</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>};</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br=
></span><span style=3D"color: #008;" class=3D"styled-by-prettify">template<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span>=
<span style=3D"color: #008;" class=3D"styled-by-prettify">class</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"co=
lor: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #=
606;" class=3D"styled-by-prettify">OverloadSet</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify">T</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">&amp;&amp;</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> x</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0</sp=
an><span style=3D"color: #008;" class=3D"styled-by-prettify">return</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span styl=
e=3D"color: #606;" class=3D"styled-by-prettify">OverloadSet</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br>=C2=A0 </span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">[]&lt;</span><span style=3D"color:=
 #008;" class=3D"styled-by-prettify">class</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">...</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"styl=
ed-by-prettify">Args</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">&gt;(</span><span style=3D"color: #606;" class=3D"styled-by-prett=
ify">Args</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&=
amp;&amp;...</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> args</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 =C2=A0noexcept</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">noexcept</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">x</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify">std</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify">forward</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #606;" class=
=3D"styled-by-prettify">Args</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">...&gt;(</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">args</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">)))</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br>=C2=A0 =C2=A0 =C2=A0</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">-&gt;</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">decltype</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">x</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify">std</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">forward</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #606;" clas=
s=3D"styled-by-prettify">Args</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">...&gt;(</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify">args</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">))</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br>=C2=A0 =C2=A0</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
><br>=C2=A0 =C2=A0 =C2=A0</span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">return</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> x</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">std</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">forward</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=
=3D"color: #606;" class=3D"styled-by-prettify">Args</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">...&gt;(</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">args</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">));</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br>=C2=A0 =C2=A0</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>=C2=A0</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">};</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
><br><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">i=
nt</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> f</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">()</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">return</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by=
-prettify">0</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 st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D=
"color: #008;" class=3D"styled-by-prettify">int</span><span style=3D"color:=
 #000;" class=3D"styled-by-prettify"> f</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">(</span><span style=3D"color: #008;" class=3D"=
styled-by-prettify">int</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">{</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #008;" class=3D"styled-by-prettify">return</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"colo=
r: #066;" class=3D"styled-by-prettify">0</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-b=
y-prettify">}</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>template</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&=
lt;</span><span style=3D"color: #008;" class=3D"styled-by-prettify">class</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> T</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">void</span><span style=3D"color:=
 #000;" class=3D"styled-by-prettify"> func</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">T</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&amp;&amp;</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> x</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r></span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0x</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span st=
yle=3D"color: #066;" class=3D"styled-by-prettify">0</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">);</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br>=C2=A0x</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">();</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br><br></span><span style=3D"color: #008;" class=3D"styled-by-=
prettify">int</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> main</span><span style=3D"color: #660;" class=3D"styled-by-prettify">()=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0func</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">f</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: #800;" class=3D=
"styled-by-prettify">/* func(OverloadSet{[]&lt;class... Args&gt;(Args&amp;&=
amp;... args)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 no=
except(noexcept(x(std::forward&lt;Args...&gt;(args)))<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -&gt; decltype(x(std::forward&lt;Arg=
s...&gt;(args))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return x(std::forward&=
lt;Args...&gt;(args));<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}=
); */</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span></d=
iv></code></div><div><br></div><div>This would allow to have a real C++ alt=
ernative to long expression, type conversions macros.</div><div>Just a thou=
ght, what do you think?</div><div>Anyway thanks for the read.</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/c0bed6aa-9fd9-42fe-9ad6-ab17b0c1d590%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/c0bed6aa-9fd9-42fe-9ad6-ab17b0c1d590=
%40isocpp.org</a>.<br />

------=_Part_3588_1446964829.1531267232168--

------=_Part_3587_1773918286.1531267232166--

.


Author: Nicol Bolas <jmckesson@gmail.com>
Date: Tue, 10 Jul 2018 17:55:23 -0700 (PDT)
Raw View
------=_Part_53679_223123436.1531270523159
Content-Type: multipart/alternative;
 boundary="----=_Part_53680_406445875.1531270523159"

------=_Part_53680_406445875.1531270523159
Content-Type: text/plain; charset="UTF-8"

On Tuesday, July 10, 2018 at 8:00:32 PM UTC-4, bastie...@gmail.com wrote:
>
> Hi,
>
> Deduction guides are great but could be even better if we were able to
> better control the conversion and why not even produce custom conversions.
>

What does a conversion function have to do with deduction guides?

For instance if you wanted this work:
>
> std::list<int> y { ... };
> std::vector<int> x { y };
>
> you could just write the following to make it work:
>
> template<Container T>
> std::vector(Container&& t) { return std::vector{t.begin(),  t.end()}; } //or
> "= expr".The block would be as restrictive as c++11's constexpr functions
>
>
So, what does that actually mean? This seems more like an external
conversion operator than a deduction guide.

There's a blanket rule in C++17 that you're not allowed to apply deduction
guides to any standard library type. If this is in some way related to
deduction guides, then that rule would have to apply here as well.

Also, much like C++11's constexpr rules, there doesn't seem to be much
reason for this restriction.

Overall, it's unclear what you're proposing exactly, how it works, or how
it relates to deduction guides.

--
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/be59efc0-55cb-444f-95da-8fdf023566c7%40isocpp.org.

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

<div dir=3D"ltr">On Tuesday, July 10, 2018 at 8:00:32 PM UTC-4, bastie...@g=
mail.com 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>Hi,</div><div><br></div><div>Deduction guides are great but could be=
 even better if we were able to better control the conversion and why not e=
ven produce custom conversions.</div></div></blockquote><div><br></div><div=
>What does a conversion function have to do with deduction guides?<br></div=
><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin=
-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"lt=
r"><div>For instance if you wanted this work:</div><div><br></div><div styl=
e=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);border=
-style:solid;border-width:1px;word-wrap:break-word"><code><div><span style=
=3D"color:#000">std</span><span style=3D"color:#660">::</span><span style=
=3D"color:#000">list</span><span style=3D"color:#080">&lt;int&gt;</span><sp=
an style=3D"color:#000"> y </span><span style=3D"color:#660">{</span><span =
style=3D"color:#000"> </span><span style=3D"color:#660">...</span><span sty=
le=3D"color:#000"> </span><span style=3D"color:#660">};</span><span style=
=3D"color:#000"><br>std</span><span style=3D"color:#660">::</span><span sty=
le=3D"color:#000">vector</span><span style=3D"color:#080">&lt;int&gt;</span=
><span style=3D"color:#000"> x </span><span style=3D"color:#660">{</span><s=
pan style=3D"color:#000"> y </span><span style=3D"color:#660">};</span></di=
v></code></div><div><br></div><div>you could just write the following to ma=
ke it work:</div><div><br></div><div style=3D"background-color:rgb(250,250,=
250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word=
-wrap:break-word"><code><div><span style=3D"color:#008">template</span><spa=
n style=3D"color:#660">&lt;</span><span style=3D"color:#606">Container</spa=
n><span style=3D"color:#000"> T</span><span style=3D"color:#660">&gt;</span=
><span style=3D"color:#000"><br>std</span><span style=3D"color:#660">::</sp=
an><span style=3D"color:#000">vector</span><span style=3D"color:#660">(</sp=
an><span style=3D"color:#606">Container</span><span style=3D"color:#660">&a=
mp;&amp;</span><span style=3D"color:#000"> t</span><span style=3D"color:#66=
0">)</span><span style=3D"color:#000"> </span><span style=3D"color:#660">{<=
/span><span style=3D"color:#000"> </span><span style=3D"color:#008">return<=
/span><span style=3D"color:#000"> std</span><span style=3D"color:#660">::</=
span><span style=3D"color:#000">vector</span><span style=3D"color:#660">{</=
span><span style=3D"color:#000">t</span><span style=3D"color:#660">.</span>=
<span style=3D"color:#008">begin</span><span style=3D"color:#660">(),</span=
><span style=3D"color:#000"> =C2=A0t</span><span style=3D"color:#660">.</sp=
an><span style=3D"color:#008">end</span><span style=3D"color:#660">()};</sp=
an><span style=3D"color:#000"> </span><span style=3D"color:#660">}</span><s=
pan style=3D"color:#000"> </span><span style=3D"color:#800">//or &quot;=3D =
expr&quot;.The block would be as restrictive as c++11&#39;s constexpr funct=
ions</span></div></code></div><div><br></div></div></blockquote><div><br></=
div><div>So, what does that actually mean? This seems more like an external=
 conversion operator than a deduction guide.<br></div><div><br></div><div>T=
here&#39;s a blanket rule in C++17 that you&#39;re not allowed to apply ded=
uction guides to any standard library type. If this is in some way related =
to deduction guides, then that rule would have to apply here as well.</div>=
<div><br></div><div>Also, much like C++11&#39;s constexpr rules, there does=
n&#39;t seem to be much reason for this restriction.</div><div><br></div><d=
iv>Overall, it&#39;s unclear what you&#39;re proposing exactly, how it work=
s, or how it relates to deduction guides.<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/be59efc0-55cb-444f-95da-8fdf023566c7%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/be59efc0-55cb-444f-95da-8fdf023566c7=
%40isocpp.org</a>.<br />

------=_Part_53680_406445875.1531270523159--

------=_Part_53679_223123436.1531270523159--

.


Author: mihailnajdenov@gmail.com
Date: Wed, 11 Jul 2018 00:47:07 -0700 (PDT)
Raw View
------=_Part_126122_1436810886.1531295227688
Content-Type: multipart/alternative;
 boundary="----=_Part_126123_1884275506.1531295227690"

------=_Part_126123_1884275506.1531295227690
Content-Type: text/plain; charset="UTF-8"



On Wednesday, July 11, 2018 at 3:00:32 AM UTC+3, bastie...@gmail.com wrote:
>
> Hi,
>
> Deduction guides are great but could be even better if we were able to
> better control the conversion and why not even produce custom conversions.
> For instance if you wanted this work:
>
> std::list<int> y { ... };
> std::vector<int> x { y };
>
> you could just write the following to make it work:
>
> template<Container T>
> std::vector(Container&& t) { return std::vector{t.begin(),  t.end()}; } //or
> "= expr".The block would be as restrictive as c++11's constexpr functions
>
>
And if those expression where preparsed and injected instead of working
> like normal function returns:
>


>
> //Implementing lazy on the library side
> template<class T>
> struct Lazy : public T
> {
>     Lazy(T&& f) : T(std::forward<T>(f)) {}
>     using T::operator();
> };
>
> template<class T>
> Lazy(T&& x) { return Lazy{[&]{ return x; }}; } //no recursion, uses given
> constructor as deduction guide
>
>

> template<class T>
> void func(Lazy<T> x)
> {
>      x();
>      x();
> }
>
> int f()
> {
>    std::cout << "hello" << std::endl;
>    return 0;
> }
>
> int main()
> {
>    func(f()); //func(Lazy{[&]{return f(); }});
> }
>
> //Implementing overload set as arguments by allowing unresolved types to
> be passed to OverloadSet before error
> template<class T>
> struct OverloadSet : public T
> {
>  Lazy(T&& f) : T(std::forward<T>(f)) {}
>  using T::operator();
> };
>
> template<class T>
> OverloadSet(T&& x)
> {
>  return OverloadSet{
>   []<class... Args>(Args&&... args)
>      noexcept(noexcept(x(std::forward<Args...>(args)))
>      -> decltype(x(std::forward<Args...>(args))
>    {
>      return x(std::forward<Args...>(args));
>    }
>  };
> }
>
> int f() { return 0; }
> int f(int) { return 0; }
>
> template<class T>
> void func(T&& x)
> {
>  x(0);
>  x();
> }
>
> int main()
> {
>  func(f); /* func(OverloadSet{[]<class... Args>(Args&&... args)
>                 noexcept(noexcept(x(std::forward<Args...>(args)))
>                 -> decltype(x(std::forward<Args...>(args))
>              {
>                 return x(std::forward<Args...>(args));
>              }); */
> }
>
> This would allow to have a real C++ alternative to long expression, type
> conversions macros.
> Just a thought, what do you think?
> Anyway thanks for the read.
>


So basically, these are external constructors. My gut feeling tells me,
these were considered and rejected (postponed?).

Needless to say all is possible if you make these plain old functions -
auto lazy(. . . ), auto OverloadSet(. . .)
Granted in the overload set case you will lose the implicit conversion.


And BTW there is no reason for these to be constexpr - they simply need to
return the correct type .

However, I see no reason recursion NOT to be a problem. But that is solvable

template<class T>
Lazy(T&& x)
{
  auto t = [&]{ return x; };
  return Lazy<decltype(t)>{std::move(t)}; *//< ### deduction guides IGNORED
if explicit type is specified *
}

 As I said, I am pretty sure this was considered - there is no way not to
have been, considering deduction guides look exactly like
constructor-returning-a-type.
I just does not have a body... yet?

--
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/18726326-2018-49e5-afb9-bfd0ae0937de%40isocpp.org.

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

<div dir=3D"ltr"><br><br>On Wednesday, July 11, 2018 at 3:00:32 AM UTC+3, b=
astie...@gmail.com 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>Hi,</div><div><br></div><div>Deduction guides are great bu=
t could be even better if we were able to better control the conversion and=
 why not even produce custom conversions.</div><div>For instance if you wan=
ted this work:</div><div><br></div><div style=3D"background-color:rgb(250,2=
50,250);border-color:rgb(187,187,187);border-style:solid;border-width:1px;w=
ord-wrap:break-word"><code><div><span style=3D"color:#000">std</span><span =
style=3D"color:#660">::</span><span style=3D"color:#000">list</span><span s=
tyle=3D"color:#080">&lt;int&gt;</span><span style=3D"color:#000"> y </span>=
<span style=3D"color:#660">{</span><span style=3D"color:#000"> </span><span=
 style=3D"color:#660">...</span><span style=3D"color:#000"> </span><span st=
yle=3D"color:#660">};</span><span style=3D"color:#000"><br>std</span><span =
style=3D"color:#660">::</span><span style=3D"color:#000">vector</span><span=
 style=3D"color:#080">&lt;int&gt;</span><span style=3D"color:#000"> x </spa=
n><span style=3D"color:#660">{</span><span style=3D"color:#000"> y </span><=
span style=3D"color:#660">};</span></div></code></div><div><br></div><div>y=
ou could just write the following to make it work:</div><div><br></div><div=
 style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);b=
order-style:solid;border-width:1px;word-wrap:break-word"><code><div><span s=
tyle=3D"color:#008">template</span><span style=3D"color:#660">&lt;</span><s=
pan style=3D"color:#606">Container</span><span style=3D"color:#000"> T</spa=
n><span style=3D"color:#660">&gt;</span><span style=3D"color:#000"><br>std<=
/span><span style=3D"color:#660">::</span><span style=3D"color:#000">vector=
</span><span style=3D"color:#660">(</span><span style=3D"color:#606">Contai=
ner</span><span style=3D"color:#660">&amp;&amp;</span><span style=3D"color:=
#000"> t</span><span style=3D"color:#660">)</span><span style=3D"color:#000=
"> </span><span style=3D"color:#660">{</span><span style=3D"color:#000"> </=
span><span style=3D"color:#008">return</span><span style=3D"color:#000"> st=
d</span><span style=3D"color:#660">::</span><span style=3D"color:#000">vect=
or</span><span style=3D"color:#660">{</span><span style=3D"color:#000">t</s=
pan><span style=3D"color:#660">.</span><span style=3D"color:#008">begin</sp=
an><span style=3D"color:#660">(),</span><span style=3D"color:#000"> =C2=A0t=
</span><span style=3D"color:#660">.</span><span style=3D"color:#008">end</s=
pan><span style=3D"color:#660">()};</span><span style=3D"color:#000"> </spa=
n><span style=3D"color:#660">}</span><span style=3D"color:#000"> </span><sp=
an style=3D"color:#800">//or &quot;=3D expr&quot;.The block would be as res=
trictive as c++11&#39;s constexpr functions</span></div></code></div><div>=
=C2=A0</div></div></blockquote><blockquote class=3D"gmail_quote" style=3D"m=
argin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"=
><div dir=3D"ltr"><div></div><div>And if those expression where preparsed a=
nd injected instead of working like normal function returns:</div></div></b=
lockquote><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margi=
n: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><di=
v dir=3D"ltr"><div><br></div><div style=3D"background-color:rgb(250,250,250=
);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wr=
ap:break-word"><code><div><span style=3D"color:#800">//Implementing lazy on=
 the library side</span><span style=3D"color:#000"><br></span><span style=
=3D"color:#008">template</span><span style=3D"color:#660">&lt;</span><span =
style=3D"color:#008">class</span><span style=3D"color:#000"> T</span><span =
style=3D"color:#660">&gt;</span><span style=3D"color:#000"><br></span><span=
 style=3D"color:#008">struct</span><span style=3D"color:#000"> </span><span=
 style=3D"color:#606">Lazy</span><span style=3D"color:#000"> </span><span s=
tyle=3D"color:#660">:</span><span style=3D"color:#000"> </span><span style=
=3D"color:#008">public</span><span style=3D"color:#000"> T<br></span><span =
style=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 <=
/span><span style=3D"color:#606">Lazy</span><span style=3D"color:#660">(</s=
pan><span style=3D"color:#000">T</span><span style=3D"color:#660">&amp;&amp=
;</span><span style=3D"color:#000"> f</span><span style=3D"color:#660">)</s=
pan><span style=3D"color:#000"> </span><span style=3D"color:#660">:</span><=
span style=3D"color:#000"> T</span><span style=3D"color:#660">(</span><span=
 style=3D"color:#000">std</span><span style=3D"color:#660">::</span><span s=
tyle=3D"color:#000">forward</span><span style=3D"color:#660">&lt;</span><sp=
an style=3D"color:#000">T</span><span style=3D"color:#660">&gt;(</span><spa=
n style=3D"color:#000">f</span><span style=3D"color:#660">))</span><span st=
yle=3D"color:#000"> </span><span style=3D"color:#660">{}</span><span style=
=3D"color:#000"> =C2=A0 =C2=A0<br>=C2=A0 =C2=A0 </span><span style=3D"color=
:#008">using</span><span style=3D"color:#000"> T</span><span style=3D"color=
:#660">::</span><span style=3D"color:#008">operator</span><span style=3D"co=
lor:#660">();</span><span style=3D"color:#000"><br></span><span style=3D"co=
lor:#660">};</span><span style=3D"color:#000"><br><br></span><span style=3D=
"color:#008">template</span><span style=3D"color:#660">&lt;</span><span sty=
le=3D"color:#008">class</span><span style=3D"color:#000"> T</span><span sty=
le=3D"color:#660">&gt;</span><span style=3D"color:#000"><br></span><span st=
yle=3D"color:#606">Lazy</span><span style=3D"color:#660">(</span><span styl=
e=3D"color:#000">T</span><span style=3D"color:#660">&amp;&amp;</span><span =
style=3D"color:#000"> x</span><span style=3D"color:#660">)</span><span styl=
e=3D"color:#000"> </span><font color=3D"#666600"><span style=3D"color:#660"=
>{</span><span style=3D"color:#000"> </span><span style=3D"color:#008">retu=
rn</span></font><span style=3D"color:#000"> </span><span style=3D"color:#60=
6">Lazy</span><span style=3D"color:#660">{[&amp;]{</span><span style=3D"col=
or:#000"> </span><span style=3D"color:#008">return</span><span style=3D"col=
or:#000"> x</span><span style=3D"color:#660">;</span><span style=3D"color:#=
000"> </span><span style=3D"color:#660">}};</span><span style=3D"color:#000=
"> </span><span style=3D"color:#660">}</span><span style=3D"color:#000"> </=
span><span style=3D"color:#800">//no recursion, uses given constructor as d=
eduction guide</span><span style=3D"color:#000"><br><br></span></div></code=
></div></div></blockquote><div>=C2=A0</div><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 style=3D"background-color:rgb(250,250,25=
0);border-color:rgb(187,187,187);border-style:solid;border-width:1px;word-w=
rap:break-word"><code><div><span style=3D"color:#000"></span><span style=3D=
"color:#008">template</span><span style=3D"color:#660">&lt;</span><span sty=
le=3D"color:#008">class</span><span style=3D"color:#000"> T</span><span sty=
le=3D"color:#660">&gt;</span><span style=3D"color:#000"><br></span><span st=
yle=3D"color:#008">void</span><span style=3D"color:#000"> func</span><span =
style=3D"color:#660">(</span><span style=3D"color:#606">Lazy</span><span st=
yle=3D"color:#660">&lt;</span><span style=3D"color:#000">T</span><span styl=
e=3D"color:#660">&gt;</span><span style=3D"color:#000"> x</span><span style=
=3D"color:#660">)</span><span style=3D"color:#000"><br></span><span style=
=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0=
x</span><span style=3D"color:#660">();</span><span style=3D"color:#000"><br=
>=C2=A0 =C2=A0 =C2=A0x</span><span style=3D"color:#660">();</span><span sty=
le=3D"color:#000"><br></span><span style=3D"color:#660">}</span><span style=
=3D"color:#000"><br><br></span><span style=3D"color:#008">int</span><span s=
tyle=3D"color:#000"> f</span><span style=3D"color:#660">()</span><span styl=
e=3D"color:#000"><br></span><span style=3D"color:#660">{</span><span style=
=3D"color:#000"><br>=C2=A0 =C2=A0std</span><span style=3D"color:#660">::</s=
pan><span style=3D"color:#000">cout </span><span style=3D"color:#660">&lt;&=
lt;</span><span style=3D"color:#000"> </span><span style=3D"color:#080">&qu=
ot;hello&quot;</span><span style=3D"color:#000"> </span><span style=3D"colo=
r:#660">&lt;&lt;</span><span style=3D"color:#000"> std</span><span style=3D=
"color:#660">::</span><span style=3D"color:#000">endl</span><span style=3D"=
color:#660">;</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0</span><spa=
n style=3D"color:#008">return</span><span style=3D"color:#000"> </span><spa=
n style=3D"color:#066">0</span><span style=3D"color:#660">;</span><span sty=
le=3D"color:#000"><br></span><span style=3D"color:#660">}</span><span style=
=3D"color:#000"><br><br></span><span style=3D"color:#008">int</span><span s=
tyle=3D"color:#000"> main</span><span style=3D"color:#660">()</span><span s=
tyle=3D"color:#000"><br></span><span style=3D"color:#660">{</span><span sty=
le=3D"color:#000"><br>=C2=A0 =C2=A0func</span><span style=3D"color:#660">(<=
/span><span style=3D"color:#000">f</span><span style=3D"color:#660">());</s=
pan><span style=3D"color:#000"> </span><span style=3D"color:#800">//func(La=
zy{[&amp;]{return f(); }});</span><span style=3D"color:#000"><br></span><sp=
an style=3D"color:#660">}</span></div></code></div><div><br></div><div styl=
e=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,187);border=
-style:solid;border-width:1px;word-wrap:break-word"><code><div><span style=
=3D"color:#800">//Implementing overload set as arguments by allowing unreso=
lved types to be passed to OverloadSet before error</span><span style=3D"co=
lor:#000"><br></span><span style=3D"color:#008">template</span><span style=
=3D"color:#660">&lt;</span><span style=3D"color:#008">class</span><span sty=
le=3D"color:#000"> T</span><span style=3D"color:#660">&gt;</span><span styl=
e=3D"color:#000"><br></span><span style=3D"color:#008">struct</span><span s=
tyle=3D"color:#000"> </span><span style=3D"color:#606">OverloadSet</span><s=
pan style=3D"color:#000"> </span><span style=3D"color:#660">:</span><span s=
tyle=3D"color:#000"> </span><span style=3D"color:#008">public</span><span s=
tyle=3D"color:#000"> T<br></span><span style=3D"color:#660">{</span><span s=
tyle=3D"color:#000"><br>=C2=A0</span><span style=3D"color:#606">Lazy</span>=
<span style=3D"color:#660">(</span><span style=3D"color:#000">T</span><span=
 style=3D"color:#660">&amp;&amp;</span><span style=3D"color:#000"> f</span>=
<span style=3D"color:#660">)</span><span style=3D"color:#000"> </span><span=
 style=3D"color:#660">:</span><span style=3D"color:#000"> T</span><span sty=
le=3D"color:#660">(</span><span style=3D"color:#000">std</span><span style=
=3D"color:#660">::</span><span style=3D"color:#000">forward</span><span sty=
le=3D"color:#660">&lt;</span><span style=3D"color:#000">T</span><span style=
=3D"color:#660">&gt;(</span><span style=3D"color:#000">f</span><span style=
=3D"color:#660">))</span><span style=3D"color:#000"> </span><span style=3D"=
color:#660">{}</span><span style=3D"color:#000"> <br>=C2=A0</span><span sty=
le=3D"color:#008">using</span><span style=3D"color:#000"> T</span><span sty=
le=3D"color:#660">::</span><span style=3D"color:#008">operator</span><span =
style=3D"color:#660">();</span><span style=3D"color:#000"><br></span><span =
style=3D"color:#660">};</span><span style=3D"color:#000"><br><br></span><sp=
an style=3D"color:#008">template</span><span style=3D"color:#660">&lt;</spa=
n><span style=3D"color:#008">class</span><span style=3D"color:#000"> T</spa=
n><span style=3D"color:#660">&gt;</span><span style=3D"color:#000"><br></sp=
an><span style=3D"color:#606">OverloadSet</span><span style=3D"color:#660">=
(</span><span style=3D"color:#000">T</span><span style=3D"color:#660">&amp;=
&amp;</span><span style=3D"color:#000"> x</span><span style=3D"color:#660">=
)</span><span style=3D"color:#000"><br></span><span style=3D"color:#660">{<=
/span><span style=3D"color:#000"><br>=C2=A0</span><span style=3D"color:#008=
">return</span><span style=3D"color:#000"> </span><span style=3D"color:#606=
">OverloadSet</span><span style=3D"color:#660">{</span><span style=3D"color=
:#000"><br>=C2=A0 </span><span style=3D"color:#660">[]&lt;</span><span styl=
e=3D"color:#008">class</span><span style=3D"color:#660">...</span><span sty=
le=3D"color:#000"> </span><span style=3D"color:#606">Args</span><span style=
=3D"color:#660">&gt;(</span><span style=3D"color:#606">Args</span><span sty=
le=3D"color:#660">&amp;&amp;...</span><span style=3D"color:#000"> args</spa=
n><span style=3D"color:#660">)</span><span style=3D"color:#000"><br>=C2=A0 =
=C2=A0 =C2=A0noexcept</span><span style=3D"color:#660">(</span><span style=
=3D"color:#000">noexcept</span><span style=3D"color:#660">(</span><span sty=
le=3D"color:#000">x</span><span style=3D"color:#660">(</span><span style=3D=
"color:#000">std</span><span style=3D"color:#660">::</span><span style=3D"c=
olor:#000">forw<wbr>ard</span><span style=3D"color:#660">&lt;</span><span s=
tyle=3D"color:#606">Args</span><span style=3D"color:#660">...&gt;(</span><s=
pan style=3D"color:#000">args</span><span style=3D"color:#660">)))</span><s=
pan style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0</span><span style=3D"colo=
r:#660">-&gt;</span><span style=3D"color:#000"> </span><span style=3D"color=
:#008">decltype</span><span style=3D"color:#660">(</span><span style=3D"col=
or:#000">x</span><span style=3D"color:#660">(</span><span style=3D"color:#0=
00">std</span><span style=3D"color:#660">::</span><span style=3D"color:#000=
">forward</span><span style=3D"color:#660">&lt;</span><span style=3D"color:=
#606">Args</span><span style=3D"color:#660">..<wbr>.&gt;(</span><span style=
=3D"color:#000">args</span><span style=3D"color:#660">))</span><span style=
=3D"color:#000"><br>=C2=A0 =C2=A0</span><span style=3D"color:#660">{</span>=
<span style=3D"color:#000"><br>=C2=A0 =C2=A0 =C2=A0</span><span style=3D"co=
lor:#008">return</span><span style=3D"color:#000"> x</span><span style=3D"c=
olor:#660">(</span><span style=3D"color:#000">std</span><span style=3D"colo=
r:#660">::</span><span style=3D"color:#000">forward</span><span style=3D"co=
lor:#660">&lt;</span><span style=3D"color:#606">Args</span><span style=3D"c=
olor:#660">...&gt;(</span><span style=3D"color:#000">args</span><span style=
=3D"color:#660">))<wbr>;</span><span style=3D"color:#000"><br>=C2=A0 =C2=A0=
</span><span style=3D"color:#660">}</span><span style=3D"color:#000"><br>=
=C2=A0</span><span style=3D"color:#660">};</span><span style=3D"color:#000"=
><br></span><span style=3D"color:#660">}</span><span style=3D"color:#000"><=
br><br></span><span style=3D"color:#008">int</span><span style=3D"color:#00=
0"> f</span><span style=3D"color:#660">()</span><span style=3D"color:#000">=
 </span><span style=3D"color:#660">{</span><span style=3D"color:#000"> </sp=
an><span style=3D"color:#008">return</span><span style=3D"color:#000"> </sp=
an><span style=3D"color:#066">0</span><span style=3D"color:#660">;</span><s=
pan style=3D"color:#000"> </span><span style=3D"color:#660">}</span><span s=
tyle=3D"color:#000"><br></span><span style=3D"color:#008">int</span><span s=
tyle=3D"color:#000"> f</span><span style=3D"color:#660">(</span><span style=
=3D"color:#008">int</span><span style=3D"color:#660">)</span><span style=3D=
"color:#000"> </span><span style=3D"color:#660">{</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#008">return</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#066">0</span><span style=3D"color:#66=
0">;</span><span style=3D"color:#000"> </span><span style=3D"color:#660">}<=
/span><span style=3D"color:#000"><br><br></span><span style=3D"color:#008">=
template</span><span style=3D"color:#660">&lt;</span><span style=3D"color:#=
008">class</span><span style=3D"color:#000"> T</span><span style=3D"color:#=
660">&gt;</span><span style=3D"color:#000"><br></span><span style=3D"color:=
#008">void</span><span style=3D"color:#000"> func</span><span style=3D"colo=
r:#660">(</span><span style=3D"color:#000">T</span><span style=3D"color:#66=
0">&amp;&amp;</span><span style=3D"color:#000"> x</span><span style=3D"colo=
r:#660">)</span><span style=3D"color:#000"><br></span><span style=3D"color:=
#660">{</span><span style=3D"color:#000"><br>=C2=A0x</span><span style=3D"c=
olor:#660">(</span><span style=3D"color:#066">0</span><span style=3D"color:=
#660">);</span><span style=3D"color:#000"><br>=C2=A0x</span><span style=3D"=
color:#660">();</span><span style=3D"color:#000"><br></span><span style=3D"=
color:#660">}</span><span style=3D"color:#000"><br><br></span><span style=
=3D"color:#008">int</span><span style=3D"color:#000"> main</span><span styl=
e=3D"color:#660">()</span><span style=3D"color:#000"><br></span><span style=
=3D"color:#660">{</span><span style=3D"color:#000"><br>=C2=A0func</span><sp=
an style=3D"color:#660">(</span><span style=3D"color:#000">f</span><span st=
yle=3D"color:#660">);</span><span style=3D"color:#000"> </span><span style=
=3D"color:#800">/* func(OverloadSet{[]&lt;class... Args&gt;(Args&amp;&amp;.=
... args)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 noexcep=
t(noexcept(x(std::<wbr>forward&lt;Args...&gt;(args)))<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 -&gt; decltype(x(std::forward&lt;Arg=
s..<wbr>.&gt;(args))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{<b=
r>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return x(std::for=
ward&lt;Args...&gt;(args))<wbr>;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0}); */</span><span style=3D"color:#000"><br></span><span style=3D=
"color:#660">}</span></div></code></div><div><br></div><div>This would allo=
w to have a real C++ alternative to long expression, type conversions macro=
s.</div><div>Just a thought, what do you think?</div><div>Anyway thanks for=
 the read.</div></div></blockquote><div><br></div><div><br></div><div>So ba=
sically, these are external constructors. My gut feeling tells me, these we=
re considered and rejected (postponed?).<br></div><div><b></b><i></i><u></u=
><sub></sub><sup></sup><strike></strike><br></div><div>Needless to say all =
is possible if you make these plain old functions - auto lazy(. . . ), auto=
 OverloadSet(. . .)</div><div>Granted in the overload set case you will los=
e the implicit conversion.=C2=A0</div><div><br></div><div><br></div><div><s=
pan style=3D"display: inline !important; float: none; background-color: tra=
nsparent; color: rgb(34, 34, 34); font-family: &quot;Arial&quot;,&quot;Helv=
etica&quot;,sans-serif; font-size: 13px; font-style: normal; font-variant: =
normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: l=
eft; text-decoration: none; text-indent: 0px; text-transform: none; -webkit=
-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;">And BTW t=
here is no reason for these to be constexpr - they simply need to return th=
e correct type .</span></div><div><br></div><div>However, I see no reason r=
ecursion NOT to be a problem. But that is solvable</div><font face=3D"couri=
er new,monospace"><br>template&lt;class T&gt;<br>Lazy(T&amp;&amp; x)=C2=A0<=
br><div>{=C2=A0</div><div>=C2=A0 auto t =3D=C2=A0<span style=3D"display: in=
line !important; float: none; background-color: transparent; color: rgb(34,=
 34, 34); font-family: courier new,monospace; font-size: 13px; font-style: =
normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orp=
hans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-tr=
ansform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-sp=
acing: 0px;">[&amp;]{ return x; };</span></div>=C2=A0 return Lazy&lt;declty=
pe(t)&gt;{std::move(t)}; <i>//&lt; ### deduction guides IGNORED if explicit=
 type is specified=C2=A0</i><br>}</font><div><span style=3D"background-colo=
r: transparent; border-bottom-color: rgb(0, 0, 0); border-bottom-style: non=
e; border-bottom-width: 0px; border-image-outset: 0; border-image-repeat: s=
tretch; border-image-slice: 100%; border-image-source: none; border-image-w=
idth: 1; border-left-color: rgb(0, 0, 0); border-left-style: none; border-l=
eft-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none;=
 border-right-width: 0px; border-top-color: rgb(0, 0, 0); border-top-style:=
 none; border-top-width: 0px; color: rgb(0, 0, 0); font-family: &amp;quot;A=
rial&amp;quot;,&amp;quot;Helvetica&amp;quot;,sans-serif; font-size: 13px; f=
ont-style: normal; font-variant: normal; font-weight: 400; letter-spacing: =
normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top=
: 0px; orphans: 2; padding-bottom: 0px; padding-left: 0px; padding-right: 0=
px; padding-top: 0px; text-align: left; text-decoration: none; text-indent:=
 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: no=
rmal; word-spacing: 0px;"></span><b></b><i></i><u></u><sub></sub><sup></sup=
><strike></strike><br></div><div>=C2=A0As I said, I am pretty sure this was=
 considered - there is no way not to have been, considering deduction guide=
s look exactly like constructor-returning-a-type.=C2=A0</div><div>I just do=
es not have a body... yet?</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/18726326-2018-49e5-afb9-bfd0ae0937de%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/18726326-2018-49e5-afb9-bfd0ae0937de=
%40isocpp.org</a>.<br />

------=_Part_126123_1884275506.1531295227690--

------=_Part_126122_1436810886.1531295227688--

.