Topic: Inheriting Lambdas (& Inheriting Standalone Functions).


Author: Kizza George Mbidde <kizza.mbidde@gmail.com>
Date: Sat, 5 Oct 2013 05:38:49 -0700 (PDT)
Raw View
------=_Part_150_32272164.1380976729157
Content-Type: text/plain; charset=ISO-8859-1



I have an *epiphany of a proposal* that extends the C++ lambda system.
However, I need your feedback on this idea before I even consider writing a
proposal.

I propose that lambdas be extended to include a syntax that states the
generated lambda class is inherited from a particular class. For example;

   * [](const auto& obj)
        -> Aventador **: Lamborghini**
    {
      **  //...lambda code...//**
        return Aventador{};
    }*

The above lambda function is generated in a class that inherits from class *
Lamborghini* (the lambda returns an *Aventador* instance). Access
specifiers could be used as in the class declaration case; the above uses
the default access specifier for classes (though public inheritance is the
motivating & more plausible usage scenario).
I was motivated by this syntax when working with a multi-core programming
library that required classes to be inherited from a class *task*. This led
to creation of several very small classes with the only member method being
the implementation of the pure virtual method inherited from base class *
task*, cause it provides the only entry point for defining parallel work
units.
With the above proposed extension, similar frameworks could simplify use by
only requiring overload of the function-application operator for classes
inheriting from a class like task;

*    auto work_unit = [](auto&& param) **: public task*** { **//...task
code...//** };*

I believe this can be extended to standalone-functions;

    *auto execute()
        -> task* **: public task**
    {
       ** //...execute code...//**
    }*

Here, function (method??) *execute()* serves as the entry point for
parallel work units, which have to inherit from base *task *& override the
pure-virtual *execute() *from class *task*. Instead of creating a whole
class just to inherit from base class *task *just to override this one *
execute()* method, the above proposed syntax enables the compiler to
generate the class for you instead, leaving you to focus on the necessary
application logic.
 The usefulness of this (extending proposal to standalone functions) is up
for debate.
I humbly await your response.
Thank you.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_150_32272164.1380976729157
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div id=3D"yui_3_7_2_1_1380976277892_2304">
<p id=3D"yui_3_7_2_1_1380976277892_2303" class=3D"yiv5461275448MsoNormal"><=
span id=3D"yui_3_7_2_1_1380976277892_2302" style=3D"font-size:13.5pt;color:=
black;">I have an <i><u>epiphany of a proposal</u></i> that extends the C++=
 lambda system. However, I need your feedback on this idea before I even co=
nsider writing a proposal.</span><span style=3D"color:black;"></span></p>=
=20
</div>
<div id=3D"yui_3_7_2_1_1380976277892_2294">
<p id=3D"yui_3_7_2_1_1380976277892_2293" class=3D"yiv5461275448MsoNormal"><=
span id=3D"yui_3_7_2_1_1380976277892_2301" style=3D"font-size:13.5pt;color:=
black;">I
 propose that lambdas be extended to include a syntax that states the=20
generated lambda class is inherited from a particular class. For=20
example;<br clear=3D"none">
<br clear=3D"none">
&nbsp;&nbsp; </span><b id=3D"yui_3_7_2_1_1380976277892_2300"><span id=3D"yu=
i_3_7_2_1_1380976277892_2299" style=3D"font-size:13.5pt;color:#0000BF;">&nb=
sp;[](const auto&amp; obj)<br clear=3D"none">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;-&gt; Aventador </span></b><b id=3D"y=
ui_3_7_2_1_1380976277892_2298"><i id=3D"yui_3_7_2_1_1380976277892_2297"><sp=
an id=3D"yui_3_7_2_1_1380976277892_2296" style=3D"font-size:13.5pt;color:ma=
roon;">: Lamborghini</span></i></b><b><span style=3D"font-size:13.5pt;color=
:#0000BF;"><br clear=3D"none">
&nbsp;&nbsp; &nbsp;{<br clear=3D"none">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;</span></b><b><i><span style=3D"font-size:13=
..5pt;color:#007F40;">&nbsp; //...lambda code...//</span></i></b><b><span st=
yle=3D"font-size:13.5pt;color:#0000BF;"><br clear=3D"none">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return Aventador{};<br clear=3D"none"=
>
&nbsp;&nbsp; &nbsp;}</span></b><span id=3D"yui_3_7_2_1_1380976277892_2305" =
style=3D"font-size:13.5pt;color:black;"><br clear=3D"none">
<br clear=3D"none">
The above lambda function is generated in a class that inherits from class =
</span>
<b><i><span style=3D"font-size:13.5pt;color:maroon;">Lamborghini</span></i>=
</b><span style=3D"font-size:13.5pt;color:black;"> (the lambda returns an
</span><b><span style=3D"font-size:13.5pt;color:#0000BF;">Aventador</span><=
/b><span id=3D"yui_3_7_2_1_1380976277892_2306" style=3D"font-size:13.5pt;co=
lor:black;">
 instance). Access specifiers could be used as in the class declaration=20
case; the above uses the default access specifier for classes (though
 public inheritance is the motivating &amp; more plausible usage=20
scenario).<br clear=3D"none">
I was motivated by this syntax when working with a multi-core=20
programming library that required classes to be inherited from a class
<b>task</b>. This led to creation of several very small classes with the
 only member method being the implementation of the pure virtual method=20
inherited from base class
<b>task</b>, cause it provides the only entry point for defining parallel w=
ork units.<br clear=3D"none">
With the above proposed extension, similar frameworks could simplify use
 by only requiring overload of the function-application operator for=20
classes inheriting from a class like task;<br clear=3D"none">
<br clear=3D"none">
</span><b><span style=3D"font-size:13.5pt;color:#0000BF;">&nbsp;&nbsp; &nbs=
p;auto work_unit =3D [](auto&amp;&amp; param)
</span></b><b id=3D"yui_3_7_2_1_1380976277892_2309"><i id=3D"yui_3_7_2_1_13=
80976277892_2308"><span id=3D"yui_3_7_2_1_1380976277892_2307" style=3D"font=
-size:13.5pt;color:maroon;">: public task*</span></i></b><b><span style=3D"=
font-size:13.5pt;color:#0000BF;"> {<i>
</i></span></b><b><i><span style=3D"font-size:13.5pt;color:#007F40;">//...t=
ask code...//</span></i></b><b><span style=3D"font-size:13.5pt;color:#0000B=
F;"> };</span></b><span style=3D"font-size:13.5pt;color:black;"><br clear=
=3D"none">
&nbsp;&nbsp; &nbsp;<br clear=3D"none">
I believe this can be extended to standalone-functions;<br clear=3D"none">
<br clear=3D"none">
&nbsp;&nbsp; &nbsp;</span><b><span style=3D"font-size:13.5pt;color:#0000BF;=
">auto execute()<br clear=3D"none">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;-&gt; task* </span></b><b><i><span st=
yle=3D"font-size:13.5pt;color:maroon;">: public task</span></i></b><b><span=
 style=3D"font-size:13.5pt;color:#0000BF;"><br clear=3D"none">
&nbsp;&nbsp; &nbsp;{<br clear=3D"none">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span></b><b><span style=3D"font-size:13.5=
pt;color:#007F40;">&nbsp;<i>//...execute code...//</i></span></b><b><span s=
tyle=3D"font-size:13.5pt;color:#0000BF;"><br clear=3D"none">
&nbsp;&nbsp; &nbsp;}</span></b><span id=3D"yui_3_7_2_1_1380976277892_2319" =
style=3D"font-size:13.5pt;color:black;"><br clear=3D"none">
&nbsp;&nbsp; &nbsp;<br clear=3D"none">
Here, function (method??) <b><i>execute()</i></b> serves as the entry point=
 for parallel work units, which have to inherit from base
<b><i>task </i></b>&amp; override the pure-virtual <b><i>execute() </i></b>=
from class
<b><i>task</i></b>. Instead of creating a whole class just to inherit from =
base class
<b><i>task </i></b>just to override this one <b><i>execute()</i></b>=20
method, the above proposed syntax enables the compiler to generate the=20
class for you instead, leaving you to focus on the necessary application
 logic.</span><span style=3D"color:black;"></span></p>=20
</div>

<span id=3D"yui_3_7_2_1_1380976277892_2318" style=3D"font-size:13.5pt;color=
:black;">The usefulness of this (extending proposal to standalone functions=
) is up for debate.<br clear=3D"none">
I humbly await your response.<br clear=3D"none">
Thank you.</span></div>

<p></p>

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

------=_Part_150_32272164.1380976729157--

.


Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Sat, 5 Oct 2013 06:16:12 -0700 (PDT)
Raw View
------=_Part_1567_6669779.1380978972706
Content-Type: text/plain; charset=ISO-8859-1

I think that can be done in library form, with following syntax:
make_adaptor<Task>([]{ /*...*/ });
Here is proof-of-concept <http://ideone.com/qJTlj2>:
#include <type_traits>
#include <iostream>

using namespace std;

struct Task
{
    virtual void operator()() = 0;
protected:
    ~Task() = default;
};

template<typename F, typename Base>
class Adaptor: public Base
{
    F f;
public:
    Adaptor(F f) : f(f) {}
    void operator()() override
    {
        f();
    }
};

template<typename Base, typename F>
Adaptor<typename decay<F>::type, Base> make_adaptor(F &&f)
{
    return { forward<F>(f) };
}

void api(Task &&x)
{
    x();
}

int main()
{
    api(make_adaptor<Task>([]
    {
        cout << "lambda" << endl;
    }));
}
There are various possible improvements like inferring call signature and
so on. So in general - it is doable.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_1567_6669779.1380978972706
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I think that can be done in library form, with following s=
yntax:<br><div class=3D"prettyprint" style=3D"background-color: rgb(250, 25=
0, 250); border-color: rgb(187, 187, 187); border-style: solid; border-widt=
h: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"s=
ubprettyprint"><span style=3D"color: #000;" class=3D"styled-by-prettify">ma=
ke_adaptor</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
&lt;</span><span style=3D"color: #606;" class=3D"styled-by-prettify">Task</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;([]{</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #800;" class=3D"styled-by-prettify">/*...*/</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">});</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br></span></div></code></div>Here is <a h=
ref=3D"http://ideone.com/qJTlj2">proof-of-concept</a>:<br><div class=3D"pre=
ttyprint" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(=
187, 187, 187); border-style: solid; border-width: 1px; word-wrap: break-wo=
rd;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=
=3D"color: #800;" class=3D"styled-by-prettify">#include</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #080;" class=3D"styled-by-prettify">&lt;type_traits&gt;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #800;" class=3D"styled-by-prettify">#include</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #080;"=
 class=3D"styled-by-prettify">&lt;iostream&gt;</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"><br><br></span><span style=3D"color: #0=
08;" class=3D"styled-by-prettify">using</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"=
styled-by-prettify">namespace</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> std</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"><br><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify=
">struct</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span><span style=3D"color: #606;" class=3D"styled-by-prettify">Task</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>&nbsp; &nbsp; </span><span s=
tyle=3D"color: #008;" class=3D"styled-by-prettify">virtual</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">void</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">operator</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">()()</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">=3D</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 st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D=
"color: #008;" class=3D"styled-by-prettify">protected</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">:</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; </span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">~</span><span style=3D"color: #60=
6;" class=3D"styled-by-prettify">Task</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">()</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">defaul=
t</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 s=
tyle=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"co=
lor: #008;" class=3D"styled-by-prettify">template</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #00=
8;" class=3D"styled-by-prettify">typename</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"style=
d-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-pret=
tify">typename</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #606;" class=3D"styled-by-prettify">Base<=
/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"> </span><span style=3D"color=
: #606;" class=3D"styled-by-prettify">Adaptor</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">:</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"sty=
led-by-prettify">public</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by-pretti=
fy">Base</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>&nbsp; &nbsp;=
 F f</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">public</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; </span><span sty=
le=3D"color: #606;" class=3D"styled-by-prettify">Adaptor</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">F 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: #660;" class=3D"style=
d-by-prettify">:</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> f</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify">f</span><sp=
an 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"><br>&nbsp; &nbsp; </span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">void</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">operator</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">()()</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">override</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"><br>&nbsp; &nbsp; </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"><br>&nbsp; &nbsp; &nbsp; &nbsp; f</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">();</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br>&nbsp; &nbsp; </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"st=
yled-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-pr=
ettify">template</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-prettify">=
typename</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span><span style=3D"color: #606;" class=3D"styled-by-prettify">Base</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"col=
or: #008;" class=3D"styled-by-prettify">typename</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> F</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: #606;" class=3D"st=
yled-by-prettify">Adaptor</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">typename</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> decay</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify">F</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;::</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify">type</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #=
606;" class=3D"styled-by-prettify">Base</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> make_adaptor</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify">F </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><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; </spa=
n><span style=3D"color: #008;" class=3D"styled-by-prettify">return</span><s=
pan 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"> forward</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify">F</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">&gt;(</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">f</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">};</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">}</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"><br><br></span><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">void</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> api</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">(</span><span style=3D"color: #606;" class=3D"st=
yled-by-prettify">Task</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">&amp;&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y">x</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; x</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">();</span><span sty=
le=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: #0=
00;" 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;" clas=
s=3D"styled-by-prettify"> main</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">()</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
>&nbsp; &nbsp; api</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">m=
ake_adaptor</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>&lt;</span><span style=3D"color: #606;" class=3D"styled-by-prettify">Task<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;([]</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nb=
sp; </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbs=
p; &nbsp; &nbsp; cout </span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">&lt;&lt;</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> </span><span style=3D"color: #080;" class=3D"styled-by-prettify"=
>"lambda"</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"> endl</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; </span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">}));</span><span s=
tyle=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></span></div></code></div>There a=
re various possible improvements like inferring call signature and so on. S=
o in general - it is doable.<br></div>

<p></p>

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

------=_Part_1567_6669779.1380978972706--

.


Author: Troy Heron <troy.heron@hixxy.org>
Date: Sun, 6 Oct 2013 05:50:52 +1000
Raw View
--047d7b33dbf28ed5b004e803bc1c
Content-Type: text/plain; charset=ISO-8859-1

I already do this, and it works quite well and the boiler-plate is also
quite minimal.

Tory


On Sat, Oct 5, 2013 at 11:16 PM, Evgeny Panasyuk
<evgeny.panasyuk@gmail.com>wrote:

> I think that can be done in library form, with following syntax:
> make_adaptor<Task>([]{ /*...*/ });
> Here is proof-of-concept <http://ideone.com/qJTlj2>:
> #include <type_traits>
> #include <iostream>
>
> using namespace std;
>
> struct Task
> {
>     virtual void operator()() = 0;
> protected:
>     ~Task() = default;
> };
>
> template<typename F, typename Base>
> class Adaptor: public Base
> {
>     F f;
> public:
>     Adaptor(F f) : f(f) {}
>     void operator()() override
>     {
>         f();
>     }
> };
>
> template<typename Base, typename F>
> Adaptor<typename decay<F>::type, Base> make_adaptor(F &&f)
> {
>     return { forward<F>(f) };
> }
>
> void api(Task &&x)
> {
>     x();
> }
>
> int main()
> {
>     api(make_adaptor<Task>([]
>     {
>         cout << "lambda" << endl;
>     }));
> }
> There are various possible improvements like inferring call signature and
> so on. So in general - it is doable.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

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

<div dir=3D"ltr">I already do this, and it works quite well and the boiler-=
plate is also quite minimal.<div><br></div><div>Tory</div></div><div class=
=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Sat, Oct 5, 2013 at =
11:16 PM, Evgeny Panasyuk <span dir=3D"ltr">&lt;<a href=3D"mailto:evgeny.pa=
nasyuk@gmail.com" target=3D"_blank">evgeny.panasyuk@gmail.com</a>&gt;</span=
> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">I think that can be done in=
 library form, with following syntax:<br><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>make_adaptor</span><span style=3D"color:#660">&lt;</=
span><span style=3D"color:#606">Task</span><span style=3D"color:#660">&gt;(=
[]{</span><span style> </span><span style=3D"color:#800">/*...*/</span><spa=
n style> </span><span style=3D"color:#660">});</span><span style><br>
</span></div></code></div>Here is <a href=3D"http://ideone.com/qJTlj2" targ=
et=3D"_blank">proof-of-concept</a>:<br><div style=3D"background-color:rgb(2=
50,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:1=
px;word-wrap:break-word">
<code><div><span style=3D"color:#800">#include</span><span style> </span><s=
pan style=3D"color:#080">&lt;type_traits&gt;</span><span style><br></span><=
span style=3D"color:#800">#include</span><span style> </span><span style=3D=
"color:#080">&lt;iostream&gt;</span><span style><br>
<br></span><span style=3D"color:#008">using</span><span style> </span><span=
 style=3D"color:#008">namespace</span><span style> std</span><span style=3D=
"color:#660">;</span><span style><br><br></span><span style=3D"color:#008">=
struct</span><span style> </span><span style=3D"color:#606">Task</span><spa=
n style><br>
</span><span style=3D"color:#660">{</span><span style><br>=A0 =A0 </span><s=
pan style=3D"color:#008">virtual</span><span style> </span><span style=3D"c=
olor:#008">void</span><span style> </span><span style=3D"color:#008">operat=
or</span><span style=3D"color:#660">()()</span><span style> </span><span st=
yle=3D"color:#660">=3D</span><span style> </span><span style=3D"color:#066"=
>0</span><span style=3D"color:#660">;</span><span style><br>
</span><span style=3D"color:#008">protected</span><span style=3D"color:#660=
">:</span><span style><br>=A0 =A0 </span><span style=3D"color:#660">~</span=
><span style=3D"color:#606">Task</span><span style=3D"color:#660">()</span>=
<span style> </span><span style=3D"color:#660">=3D</span><span style> </spa=
n><span style=3D"color:#008">default</span><span style=3D"color:#660">;</sp=
an><span style><br>
</span><span style=3D"color:#660">};</span><span style><br><br></span><span=
 style=3D"color:#008">template</span><span style=3D"color:#660">&lt;</span>=
<span style=3D"color:#008">typename</span><span style> F</span><span style=
=3D"color:#660">,</span><span style> </span><span style=3D"color:#008">type=
name</span><span style> </span><span style=3D"color:#606">Base</span><span =
style=3D"color:#660">&gt;</span><span style><br>
</span><span style=3D"color:#008">class</span><span style> </span><span sty=
le=3D"color:#606">Adaptor</span><span style=3D"color:#660">:</span><span st=
yle> </span><span style=3D"color:#008">public</span><span style> </span><sp=
an style=3D"color:#606">Base</span><span style><br>
</span><span style=3D"color:#660">{</span><span style><br>=A0 =A0 F f</span=
><span style=3D"color:#660">;</span><span style><br></span><span style=3D"c=
olor:#008">public</span><span style=3D"color:#660">:</span><span style><br>=
=A0 =A0 </span><span style=3D"color:#606">Adaptor</span><span style=3D"colo=
r:#660">(</span><span style>F f</span><span style=3D"color:#660">)</span><s=
pan style> </span><span style=3D"color:#660">:</span><span style> f</span><=
span style=3D"color:#660">(</span><span style>f</span><span style=3D"color:=
#660">)</span><span style> </span><span style=3D"color:#660">{}</span><span=
 style><br>
=A0 =A0 </span><span style=3D"color:#008">void</span><span style> </span><s=
pan style=3D"color:#008">operator</span><span style=3D"color:#660">()()</sp=
an><span style> </span><span style=3D"color:#008">override</span><span styl=
e><br>=A0 =A0 </span><span style=3D"color:#660">{</span><span style><br>
=A0 =A0 =A0 =A0 f</span><span style=3D"color:#660">();</span><span style><b=
r>=A0 =A0 </span><span style=3D"color:#660">}</span><span style><br></span>=
<span style=3D"color:#660">};</span><span style><br><br></span><span style=
=3D"color:#008">template</span><span style=3D"color:#660">&lt;</span><span =
style=3D"color:#008">typename</span><span style> </span><span style=3D"colo=
r:#606">Base</span><span style=3D"color:#660">,</span><span style> </span><=
span style=3D"color:#008">typename</span><span style> F</span><span style=
=3D"color:#660">&gt;</span><span style><br>
</span><span style=3D"color:#606">Adaptor</span><span style=3D"color:#660">=
&lt;</span><span style=3D"color:#008">typename</span><span style> decay</sp=
an><span style=3D"color:#660">&lt;</span><span style>F</span><span style=3D=
"color:#660">&gt;::</span><span style>type</span><span style=3D"color:#660"=
>,</span><span style> </span><span style=3D"color:#606">Base</span><span st=
yle=3D"color:#660">&gt;</span><span style> make_adaptor</span><span style=
=3D"color:#660">(</span><span style>F </span><span style=3D"color:#660">&am=
p;&amp;</span><span style>f</span><span style=3D"color:#660">)</span><span =
style><br>
</span><span style=3D"color:#660">{</span><span style><br>=A0 =A0 </span><s=
pan style=3D"color:#008">return</span><span style> </span><span style=3D"co=
lor:#660">{</span><span style> forward</span><span style=3D"color:#660">&lt=
;</span><span style>F</span><span style=3D"color:#660">&gt;(</span><span st=
yle>f</span><span style=3D"color:#660">)</span><span style> </span><span st=
yle=3D"color:#660">};</span><span style><br>
</span><span style=3D"color:#660">}</span><span style><br><br></span><span =
style=3D"color:#008">void</span><span style> api</span><span style=3D"color=
:#660">(</span><span style=3D"color:#606">Task</span><span style> </span><s=
pan style=3D"color:#660">&amp;&amp;</span><span style>x</span><span style=
=3D"color:#660">)</span><span style><br>
</span><span style=3D"color:#660">{</span><span style><br>=A0 =A0 x</span><=
span style=3D"color:#660">();</span><span style><br></span><span style=3D"c=
olor:#660">}</span><span style><br><br></span><span style=3D"color:#008">in=
t</span><span style> main</span><span style=3D"color:#660">()</span><span s=
tyle><br>
</span><span style=3D"color:#660">{</span><span style><br>=A0 =A0 api</span=
><span style=3D"color:#660">(</span><span style>make_adaptor</span><span st=
yle=3D"color:#660">&lt;</span><span style=3D"color:#606">Task</span><span s=
tyle=3D"color:#660">&gt;([]</span><span style><br>
=A0 =A0 </span><span style=3D"color:#660">{</span><span style><br>=A0 =A0 =
=A0 =A0 cout </span><span style=3D"color:#660">&lt;&lt;</span><span style> =
</span><span style=3D"color:#080">&quot;lambda&quot;</span><span style> </s=
pan><span style=3D"color:#660">&lt;&lt;</span><span style> endl</span><span=
 style=3D"color:#660">;</span><span style><br>
=A0 =A0 </span><span style=3D"color:#660">}));</span><span style><br></span=
><span style=3D"color:#660">}</span><span style><br></span></div></code></d=
iv>There are various possible improvements like inferring call signature an=
d so on. So in general - it is doable.<br>
</div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

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

<p></p>

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

--047d7b33dbf28ed5b004e803bc1c--

.


Author: kizza.mbidde@gmail.com
Date: Sat, 5 Oct 2013 05:37:43 -0700 (PDT)
Raw View
------=_Part_1030_26956070.1380976663338
Content-Type: text/plain; charset=ISO-8859-1



I have an *epiphany of a proposal* that extends the C++ lambda system.
However, I need your feedback on this idea before I even consider writing a
proposal.

I propose that lambdas be extended to include a syntax that states the
generated lambda class is inherited from a particular class. For example;

   * [](const auto& obj)
        -> Aventador **: Lamborghini**
    {
      **  //...lambda code...//**
        return Aventador{};
    }*

The above lambda function is generated in a class that inherits from class *
Lamborghini* (the lambda returns an *Aventador* instance). Access
specifiers could be used as in the class declaration case; the above uses
the default access specifier for classes (though public inheritance is the
motivating & more plausible usage scenario).
I was motivated by this syntax when working with a multi-core programming
library that required classes to be inherited from a class *task*. This led
to creation of several very small classes with the only member method being
the implementation of the pure virtual method inherited from base class *
task*, cause it provides the only entry point for defining parallel work
units.
With the above proposed extension, similar frameworks could simplify use by
only requiring overload of the function-application operator for classes
inheriting from a class like task;

*    auto work_unit = [](auto&& param) **: public task*** { **//...task
code...//** };*

I believe this can be extended to standalone-functions;

    *auto execute()
        -> task* **: public task**
    {
       ** //...execute code...//**
    }*

Here, function (method??) *execute()* serves as the entry point for
parallel work units, which have to inherit from base *task *& override the
pure-virtual *execute() *from class *task*. Instead of creating a whole
class just to inherit from base class *task *just to override this one *
execute()* method, the above proposed syntax enables the compiler to
generate the class for you instead, leaving you to focus on the necessary
application logic.
 The usefulness of this (extending proposal to standalone functions) is up
for debate.
I humbly await your response.
Thank you.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_1030_26956070.1380976663338
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div id=3D"yui_3_7_2_1_1380976277892_2304">
<p id=3D"yui_3_7_2_1_1380976277892_2303" class=3D"yiv5461275448MsoNormal"><=
span id=3D"yui_3_7_2_1_1380976277892_2302" style=3D"font-size:13.5pt;color:=
black;">I have an <i><u>epiphany of a proposal</u></i> that extends the C++=
 lambda system. However, I need your feedback on this idea before I even co=
nsider writing a proposal.</span><span style=3D"color:black;"></span></p>=
=20
</div>
<div id=3D"yui_3_7_2_1_1380976277892_2294">
<p id=3D"yui_3_7_2_1_1380976277892_2293" class=3D"yiv5461275448MsoNormal"><=
span id=3D"yui_3_7_2_1_1380976277892_2301" style=3D"font-size:13.5pt;color:=
black;">I
 propose that lambdas be extended to include a syntax that states the=20
generated lambda class is inherited from a particular class. For=20
example;<br clear=3D"none">
<br clear=3D"none">
&nbsp;&nbsp; </span><b id=3D"yui_3_7_2_1_1380976277892_2300"><span id=3D"yu=
i_3_7_2_1_1380976277892_2299" style=3D"font-size:13.5pt;color:#0000BF;">&nb=
sp;[](const auto&amp; obj)<br clear=3D"none">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;-&gt; Aventador </span></b><b id=3D"y=
ui_3_7_2_1_1380976277892_2298"><i id=3D"yui_3_7_2_1_1380976277892_2297"><sp=
an id=3D"yui_3_7_2_1_1380976277892_2296" style=3D"font-size:13.5pt;color:ma=
roon;">: Lamborghini</span></i></b><b><span style=3D"font-size:13.5pt;color=
:#0000BF;"><br clear=3D"none">
&nbsp;&nbsp; &nbsp;{<br clear=3D"none">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;</span></b><b><i><span style=3D"font-size:13=
..5pt;color:#007F40;">&nbsp; //...lambda code...//</span></i></b><b><span st=
yle=3D"font-size:13.5pt;color:#0000BF;"><br clear=3D"none">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;return Aventador{};<br clear=3D"none"=
>
&nbsp;&nbsp; &nbsp;}</span></b><span id=3D"yui_3_7_2_1_1380976277892_2305" =
style=3D"font-size:13.5pt;color:black;"><br clear=3D"none">
<br clear=3D"none">
The above lambda function is generated in a class that inherits from class =
</span>
<b><i><span style=3D"font-size:13.5pt;color:maroon;">Lamborghini</span></i>=
</b><span style=3D"font-size:13.5pt;color:black;"> (the lambda returns an
</span><b><span style=3D"font-size:13.5pt;color:#0000BF;">Aventador</span><=
/b><span id=3D"yui_3_7_2_1_1380976277892_2306" style=3D"font-size:13.5pt;co=
lor:black;">
 instance). Access specifiers could be used as in the class declaration=20
case; the above uses the default access specifier for classes (though
 public inheritance is the motivating &amp; more plausible usage=20
scenario).<br clear=3D"none">
I was motivated by this syntax when working with a multi-core=20
programming library that required classes to be inherited from a class
<b>task</b>. This led to creation of several very small classes with the
 only member method being the implementation of the pure virtual method=20
inherited from base class
<b>task</b>, cause it provides the only entry point for defining parallel w=
ork units.<br clear=3D"none">
With the above proposed extension, similar frameworks could simplify use
 by only requiring overload of the function-application operator for=20
classes inheriting from a class like task;<br clear=3D"none">
<br clear=3D"none">
</span><b><span style=3D"font-size:13.5pt;color:#0000BF;">&nbsp;&nbsp; &nbs=
p;auto work_unit =3D [](auto&amp;&amp; param)
</span></b><b id=3D"yui_3_7_2_1_1380976277892_2309"><i id=3D"yui_3_7_2_1_13=
80976277892_2308"><span id=3D"yui_3_7_2_1_1380976277892_2307" style=3D"font=
-size:13.5pt;color:maroon;">: public task*</span></i></b><b><span style=3D"=
font-size:13.5pt;color:#0000BF;"> {<i>
</i></span></b><b><i><span style=3D"font-size:13.5pt;color:#007F40;">//...t=
ask code...//</span></i></b><b><span style=3D"font-size:13.5pt;color:#0000B=
F;"> };</span></b><span style=3D"font-size:13.5pt;color:black;"><br clear=
=3D"none">
&nbsp;&nbsp; &nbsp;<br clear=3D"none">
I believe this can be extended to standalone-functions;<br clear=3D"none">
<br clear=3D"none">
&nbsp;&nbsp; &nbsp;</span><b><span style=3D"font-size:13.5pt;color:#0000BF;=
">auto execute()<br clear=3D"none">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;-&gt; task* </span></b><b><i><span st=
yle=3D"font-size:13.5pt;color:maroon;">: public task</span></i></b><b><span=
 style=3D"font-size:13.5pt;color:#0000BF;"><br clear=3D"none">
&nbsp;&nbsp; &nbsp;{<br clear=3D"none">
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </span></b><b><span style=3D"font-size:13.5=
pt;color:#007F40;">&nbsp;<i>//...execute code...//</i></span></b><b><span s=
tyle=3D"font-size:13.5pt;color:#0000BF;"><br clear=3D"none">
&nbsp;&nbsp; &nbsp;}</span></b><span id=3D"yui_3_7_2_1_1380976277892_2319" =
style=3D"font-size:13.5pt;color:black;"><br clear=3D"none">
&nbsp;&nbsp; &nbsp;<br clear=3D"none">
Here, function (method??) <b><i>execute()</i></b> serves as the entry point=
 for parallel work units, which have to inherit from base
<b><i>task </i></b>&amp; override the pure-virtual <b><i>execute() </i></b>=
from class
<b><i>task</i></b>. Instead of creating a whole class just to inherit from =
base class
<b><i>task </i></b>just to override this one <b><i>execute()</i></b>=20
method, the above proposed syntax enables the compiler to generate the=20
class for you instead, leaving you to focus on the necessary application
 logic.</span><span style=3D"color:black;"></span></p>=20
</div>

<span id=3D"yui_3_7_2_1_1380976277892_2318" style=3D"font-size:13.5pt;color=
:black;">The usefulness of this (extending proposal to standalone functions=
) is up for debate.<br clear=3D"none">
I humbly await your response.<br clear=3D"none">
Thank you.</span></div>

<p></p>

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

------=_Part_1030_26956070.1380976663338--

.


Author: Evgeny Panasyuk <evgeny.panasyuk@gmail.com>
Date: Sat, 5 Oct 2013 14:06:12 -0700 (PDT)
Raw View
------=_Part_1814_23333708.1381007172377
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

5 oct 2013 =C7., 23:50:52 UTC+4 Troy Heron:
>
> I already do this, and it works quite well and the boiler-plate is also=
=20
> quite minimal.
>

Could you please clarify - what kind of boilerplate do you mean? At user=20
side or at implementation side?
I think that at user side there should be no boilerplate at all - just=20
specify which base class should be "inherited".

--=20

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

------=_Part_1814_23333708.1381007172377
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">5 oct 2013&nbsp;=C7., 23:50:52 UTC+4 Troy Heron:<blockquot=
e class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: =
1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">I already do this, and =
it works quite well and the boiler-plate is also quite minimal.</div></bloc=
kquote><div><br>Could you please clarify - what kind of boilerplate do you =
mean? At user side or at implementation side?<br>I think that at user side =
there should be no boilerplate at all - just specify which base class shoul=
d be "inherited".<br></div></div>

<p></p>

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

------=_Part_1814_23333708.1381007172377--

.


Author: Troy Heron <troy.heron@hixxy.org>
Date: Sun, 6 Oct 2013 07:22:33 +1000
Raw View
--047d7b67378467714904e8050443
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Implementation side and as I said, it's very minimal. That's a good thing!


On Sun, Oct 6, 2013 at 7:06 AM, Evgeny Panasyuk
<evgeny.panasyuk@gmail.com>wrote:

> 5 oct 2013 =D0=B3., 23:50:52 UTC+4 Troy Heron:
>
>> I already do this, and it works quite well and the boiler-plate is also
>> quite minimal.
>>
>
> Could you please clarify - what kind of boilerplate do you mean? At user
> side or at implementation side?
> I think that at user side there should be no boilerplate at all - just
> specify which base class should be "inherited".
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

--=20

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

--047d7b67378467714904e8050443
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Implementation side and as I said, it&#39;s very minimal. =
That&#39;s a good thing!</div><div class=3D"gmail_extra"><br><br><div class=
=3D"gmail_quote">On Sun, Oct 6, 2013 at 7:06 AM, Evgeny Panasyuk <span dir=
=3D"ltr">&lt;<a href=3D"mailto:evgeny.panasyuk@gmail.com" target=3D"_blank"=
>evgeny.panasyuk@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">5 oct 2013=9A=C7., 23:50:52=
 UTC+4 Troy Heron:<div class=3D"im"><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">I already do this, and it works quite well and the boiler-=
plate is also quite minimal.</div></blockquote></div><div><br>Could you ple=
ase clarify - what kind of boilerplate do you mean? At user side or at impl=
ementation side?<br>
I think that at user side there should be no boilerplate at all - just spec=
ify which base class should be &quot;inherited&quot;.<br></div></div><div c=
lass=3D"HOEnZb"><div class=3D"h5">

<p></p>

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

<p></p>

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

--047d7b67378467714904e8050443--

.