Topic: std::vector - adding support for non-moveable,
Author: Matthew Fioravante <fmatthew5876@gmail.com>
Date: Thu, 25 Jun 2015 09:06:32 -0700 (PDT)
Raw View
------=_Part_580_315244470.1435248392056
Content-Type: multipart/alternative;
boundary="----=_Part_581_661778710.1435248392068"
------=_Part_581_661778710.1435248392068
Content-Type: text/plain; charset=UTF-8
If you have a type T that has deleted move/copy operations and you want to
store objects of this type in a vector you are forced to default construct
the elements use the vector<T>::vector(size_t) constructor. After this you
can naturally not push_back(), insert(), reserve(), etc.. as all of those
operations may require moves.
If we want to call a different constructor, or we don't have a default
constructor for T we are out of luck and cannot use vector.
We need to modify the behavior inside of vector's constructor to customize
which constructor for T is actually called. The way to do this is with
functional programming, that is we pass in a lambda to the vector
constructor telling it how to construct each element.
I presented an idea similar to this in a different thread for another array
type, but I think this idea could be applied to vector.
The interface would look like this:
template <typename T, typename Alloc> template <typename ConsFunc>
vector<T,Alloc>::vector(size_t n, ConsFunc&& f, const Alloc& = Alloc());
And here are examples how it would be used:
vector<int> v1(4, [](auto make) { make(2); }); //Constructs the vector [2,
2, 2, 2]
int i = 0;
vector<int> v2(5, [=](auto make) mutable { make(i++); }); //Constructs the
vector [0, 1, 2, 3, 4]
The object passed to our lambda called 'make' in this example is another
function object which just forwards the arguments into placement new /
Alloc::construct().
The make object would have this interface. It could be a lambda itself or a
nested functor type inside of vector. We can leave the actual type
definition as an implementation detail. All it needs to do is define the
following operator() const.
struct make_fn {
//Constructs the element in place and then returns a reference to the
element.
template <typename... Args> auto& operator() const (Args&&...);
};
vector could also implement the following optimizations if T is non-movable
- Always allocate exactly n elements, since we can never grow the data
structure
- Store the size and capacity in the same data member since they are
redundant, reducing the size of vector from 3 pointers to 2.
--
---
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_581_661778710.1435248392068
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">If you have a type T that has deleted move/copy operations=
and you want to store objects of this type in a vector you are forced to d=
efault construct the elements use the vector<T>::vector(size_t) const=
ructor. After this you can naturally not push_back(), insert(), reserve(), =
etc.. as all of those operations may require moves.<br><br>If we want to ca=
ll a different constructor, or we don't have a default constructor for T we=
are out of luck and cannot use vector.<br><br>We need to modify the behavi=
or inside of vector's constructor to customize which constructor for T is a=
ctually called. The way to do this is with functional programming, that is =
we pass in a lambda to the vector constructor telling it how to construct e=
ach element.<br><br>I presented an idea similar to this in a different thre=
ad for another array type, but I think this idea could be applied to vector=
..<br><br>The interface would look like this:<br><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: =
#008;" class=3D"styled-by-prettify">template</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify"><</span><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">typename</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> T</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
</span><span style=3D"color: #008;" class=3D"styled-by-prettify">typename<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an style=3D"color: #606;" class=3D"styled-by-prettify">Alloc</span><span st=
yle=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">template</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify"><</span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">typename</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by-pre=
ttify">ConsFunc</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">></span><span style=3D"color: #000;" class=3D"styled-by-prettify"><=
br>vector</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">,</span><span st=
yle=3D"color: #606;" class=3D"styled-by-prettify">Alloc</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"colo=
r: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify">size_t n</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by-=
prettify">ConsFunc</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">&&</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> 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: #008;" class=3D"styled-by-prettify">const</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"=
color: #606;" class=3D"styled-by-prettify">Alloc</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">&</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by-pr=
ettify">Alloc</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">());</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
></span></div></code></div><br>And here are examples how it would be used:<=
br><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"subprett=
yprint"><span style=3D"color: #000;" class=3D"styled-by-prettify">vector</s=
pan><span style=3D"color: #080;" class=3D"styled-by-prettify"><int></=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> v1</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">4</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">[](</span><span style=3D"color: #008;" class=3D"styled-=
by-prettify">auto</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> make</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"> make</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color=
: #066;" class=3D"styled-by-prettify">2</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-prett=
ify"> </span><span style=3D"color: #800;" class=3D"styled-by-prettify">//Co=
nstructs the vector [2, 2, 2, 2]</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"sty=
led-by-prettify"> i </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: #066;" class=3D"styled-by-prettify">0</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br>vector</span><span s=
tyle=3D"color: #080;" class=3D"styled-by-prettify"><int></span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> v2</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color=
: #066;" class=3D"styled-by-prettify">5</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">[=3D](</span><span style=3D"color: #008;" class=3D"styled-by-pre=
ttify">auto</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> make</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span=
style=3D"color: #008;" class=3D"styled-by-prettify">mutable</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> make</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify">i</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">++);</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">});</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span=
style=3D"color: #800;" class=3D"styled-by-prettify">//Constructs the vecto=
r [0, 1, 2, 3, 4]</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"><br></span></div></code></div><br>The object passed to our lambda ca=
lled 'make' in this example is another function object which just forwards =
the arguments into placement new / Alloc::construct().<br><br>The make obje=
ct would have this interface. It could be a lambda itself or a nested funct=
or type inside of vector. We can leave the actual type definition as an imp=
lementation detail. All it needs to do is define the following operat=
or() const.<br><div class=3D"prettyprint" style=3D"background-color: rgb(25=
0, 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: #008;" class=3D"styled-by-prettif=
y">struct</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
make_fn </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: #800;" class=3D"styled-by-prettify">//Construc=
ts the element in place and then returns a reference to the element.</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: #000;" class=3D"styled-by-prettify"> </span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify"><</span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">typename</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">...</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=
=3D"styled-by-prettify">Args</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">></span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">auto</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&am=
p;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span>=
<span style=3D"color: #008;" class=3D"styled-by-prettify">operator</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">()</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">const</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" 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">&&...);</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></span></div></code></div><br>vector could also implement the followin=
g optimizations if T is non-movable<br>- Always allocate exactly n elements=
, since we can never grow the data structure<br>- Store the size and capaci=
ty in the same data member since they are redundant, reducing the size of v=
ector from 3 pointers to 2.<br><br><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_581_661778710.1435248392068--
------=_Part_580_315244470.1435248392056--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 25 Jun 2015 19:12:26 +0300
Raw View
On 25 June 2015 at 19:06, Matthew Fioravante <fmatthew5876@gmail.com> wrote:
> If you have a type T that has deleted move/copy operations and you want to
> store objects of this type in a vector you are forced to default construct
> the elements use the vector<T>::vector(size_t) constructor. After this you
> can naturally not push_back(), insert(), reserve(), etc.. as all of those
> operations may require moves.
>
> If we want to call a different constructor, or we don't have a default
> constructor for T we are out of luck and cannot use vector.
>
> We need to modify the behavior inside of vector's constructor to customize
> which constructor for T is actually called. The way to do this is with
> functional programming, that is we pass in a lambda to the vector
> constructor telling it how to construct each element.
>
> I presented an idea similar to this in a different thread for another array
> type, but I think this idea could be applied to vector.
This might be useful background:
http://cplusplus.github.io/LWG/lwg-defects.html#704
At one time, Gabriel Dos Reis discussed relaxing some of the type requirements
for vector, but I don't think either of us were able to materialize
that discussion into
a proposal. Both of us are fairly busy, so I cannot promise that
either will be able
to provide much assistance. Gabriel might have good suggestions. Maybe.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 25 Jun 2015 22:05:36 +0300
Raw View
On 25 June 2015 at 19:12, Ville Voutilainen <ville.voutilainen@gmail.com> wrote:
> On 25 June 2015 at 19:06, Matthew Fioravante <fmatthew5876@gmail.com> wrote:
>> If you have a type T that has deleted move/copy operations and you want to
>> store objects of this type in a vector you are forced to default construct
>> the elements use the vector<T>::vector(size_t) constructor. After this you
>> can naturally not push_back(), insert(), reserve(), etc.. as all of those
>> operations may require moves.
>>
>> If we want to call a different constructor, or we don't have a default
>> constructor for T we are out of luck and cannot use vector.
>>
>> We need to modify the behavior inside of vector's constructor to customize
>> which constructor for T is actually called. The way to do this is with
>> functional programming, that is we pass in a lambda to the vector
>> constructor telling it how to construct each element.
>>
>> I presented an idea similar to this in a different thread for another array
>> type, but I think this idea could be applied to vector.
>
> This might be useful background:
> http://cplusplus.github.io/LWG/lwg-defects.html#704
>
> At one time, Gabriel Dos Reis discussed relaxing some of the type requirements
> for vector, but I don't think either of us were able to materialize
> that discussion into
> a proposal. Both of us are fairly busy, so I cannot promise that
> either will be able
> to provide much assistance. Gabriel might have good suggestions. Maybe.
Ah. Also see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4416.pdf.
That
proposal was rejected by LEWG, though.
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Thu, 25 Jun 2015 22:07:49 +0300
Raw View
On 25 June 2015 at 22:05, Ville Voutilainen <ville.voutilainen@gmail.com> wrote:
> On 25 June 2015 at 19:12, Ville Voutilainen <ville.voutilainen@gmail.com> wrote:
>> On 25 June 2015 at 19:06, Matthew Fioravante <fmatthew5876@gmail.com> wrote:
>>> If you have a type T that has deleted move/copy operations and you want to
>>> store objects of this type in a vector you are forced to default construct
>>> the elements use the vector<T>::vector(size_t) constructor. After this you
>>> can naturally not push_back(), insert(), reserve(), etc.. as all of those
>>> operations may require moves.
>>>
>>> If we want to call a different constructor, or we don't have a default
>>> constructor for T we are out of luck and cannot use vector.
>>>
>>> We need to modify the behavior inside of vector's constructor to customize
>>> which constructor for T is actually called. The way to do this is with
>>> functional programming, that is we pass in a lambda to the vector
>>> constructor telling it how to construct each element.
>>>
>>> I presented an idea similar to this in a different thread for another array
>>> type, but I think this idea could be applied to vector.
>>
>> This might be useful background:
>> http://cplusplus.github.io/LWG/lwg-defects.html#704
>>
>> At one time, Gabriel Dos Reis discussed relaxing some of the type requirements
>> for vector, but I don't think either of us were able to materialize
>> that discussion into
>> a proposal. Both of us are fairly busy, so I cannot promise that
>> either will be able
>> to provide much assistance. Gabriel might have good suggestions. Maybe.
>
> Ah. Also see http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4416.pdf.
> That
> proposal was rejected by LEWG, though.
The discussion summary is at https://issues.isocpp.org/show_bug.cgi?id=87
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: Matthew Fioravante <fmatthew5876@gmail.com>
Date: Sat, 27 Jun 2015 15:56:48 -0700 (PDT)
Raw View
------=_Part_434_1781855643.1435445809022
Content-Type: multipart/alternative;
boundary="----=_Part_435_988334486.1435445809022"
------=_Part_435_988334486.1435445809022
Content-Type: text/plain; charset=UTF-8
I've started a paper here:
https://github.com/fmatthew5876/stdcxx-lambda-init/blob/master/proposal/draft.md
I still have to work out the details, but the basic idea is there.
Does anyone believe such a feature would be a complete non-starter? What
objections would you have to such a feature? I'd like to gauge at least
some level of possibility or interest before spending too much time
polishing a proposal. Any suggestions to the paper would be very welcome
too.
Ville, thanks for the links. I'll include a section about that paper as a
"previous work" later.
--
---
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_435_988334486.1435445809022
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I've started a paper here:<div>https://github.com/fmatthew=
5876/stdcxx-lambda-init/blob/master/proposal/draft.md</div><div><br></div><=
div>I still have to work out the details, but the basic idea is there.</div=
><div><br></div><div>Does anyone believe such a feature would be a complete=
non-starter? What objections would you have to such a feature? I'd like to=
gauge at least some level of possibility or interest before spending too m=
uch time polishing a proposal. Any suggestions to the paper would be very w=
elcome too.</div><div><br></div><div>Ville, thanks for the links. I'll incl=
ude a section about that paper as a "previous work" later.</div></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
------=_Part_435_988334486.1435445809022--
------=_Part_434_1781855643.1435445809022--
.
Author: Patrice Roy <patricer@gmail.com>
Date: Sat, 27 Jun 2015 19:06:43 -0400
Raw View
--001a11c27cf0f9a5d3051987e814
Content-Type: text/plain; charset=UTF-8
It seems to me to fill a gap in terms of functionality; I can't count the
number of times I've written code that went around the fact that this
constructor form was not available. I have to think more about the format,
but the essence that you're trying to get to seems like something we need
to me.
Cheers!
2015-06-27 18:56 GMT-04:00 Matthew Fioravante <fmatthew5876@gmail.com>:
> I've started a paper here:
>
> https://github.com/fmatthew5876/stdcxx-lambda-init/blob/master/proposal/draft.md
>
> I still have to work out the details, but the basic idea is there.
>
> Does anyone believe such a feature would be a complete non-starter? What
> objections would you have to such a feature? I'd like to gauge at least
> some level of possibility or interest before spending too much time
> polishing a proposal. Any suggestions to the paper would be very welcome
> too.
>
> Ville, thanks for the links. I'll include a section about that paper as a
> "previous work" later.
>
> --
>
> ---
> 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/.
--001a11c27cf0f9a5d3051987e814
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>It seems to me to fill a gap in terms of functionalit=
y; I can't count the number of times I've written code that went ar=
ound the fact that this constructor form was not available. I have to think=
more about the format, but the essence that you're trying to get to se=
ems like something we need to me.<br><br></div>Cheers!<br></div><div class=
=3D"gmail_extra"><br><div class=3D"gmail_quote">2015-06-27 18:56 GMT-04:00 =
Matthew Fioravante <span dir=3D"ltr"><<a href=3D"mailto:fmatthew5876@gma=
il.com" target=3D"_blank">fmatthew5876@gmail.com</a>></span>:<br><blockq=
uote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc =
solid;padding-left:1ex"><div dir=3D"ltr">I've started a paper here:<div=
><a href=3D"https://github.com/fmatthew5876/stdcxx-lambda-init/blob/master/=
proposal/draft.md" target=3D"_blank">https://github.com/fmatthew5876/stdcxx=
-lambda-init/blob/master/proposal/draft.md</a></div><div><br></div><div>I s=
till have to work out the details, but the basic idea is there.</div><div><=
br></div><div>Does anyone believe such a feature would be a complete non-st=
arter? What objections would you have to such a feature? I'd like to ga=
uge at least some level of possibility or interest before spending too much=
time polishing a proposal. Any suggestions to the paper would be very welc=
ome too.</div><div><br></div><div>Ville, thanks for the links. I'll inc=
lude a section about that paper as a "previous work" later.</div>=
</div><div class=3D"HOEnZb"><div class=3D"h5">
<p></p>
-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />
--001a11c27cf0f9a5d3051987e814--
.
Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Sun, 28 Jun 2015 02:23:25 +0300
Raw View
On 28 June 2015 at 01:56, Matthew Fioravante <fmatthew5876@gmail.com> wrote:
> I've started a paper here:
> https://github.com/fmatthew5876/stdcxx-lambda-init/blob/master/proposal/draft.md
I find that you might be able to support aggregates, by using a technique
similar to the one described in this paper:
http://open-std.org/JTC1/SC22/WG21/docs/papers/2015/n4462.html
--
---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.
.
Author: "dgutson ." <danielgutson@gmail.com>
Date: Sun, 28 Jun 2015 08:37:19 -0300
Raw View
--001a1141ca82633d6f0519926565
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
El 27/6/2015 20:23, "Ville Voutilainen" <ville.voutilainen@gmail.com>
escribi=C3=B3:
>
> On 28 June 2015 at 01:56, Matthew Fioravante <fmatthew5876@gmail.com>
wrote:
> > I've started a paper here:
> >
https://github.com/fmatthew5876/stdcxx-lambda-init/blob/master/proposal/dra=
ft.md
>
> I find that you might be able to support aggregates, by using a technique
> similar to the one described in this paper:
> http://open-std.org/JTC1/SC22/WG21/docs/papers/2015/n4462.html
This was pre-lambdas of course:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1467.pdf
Two things from my jurassic paper may be useful: 1) the argument telling
the indices (tuple?) of the element being constructed, 2) make it useful
for multidimensional arrays
>
> --
>
> ---
> 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/.
--001a1141ca82633d6f0519926565
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<p dir=3D"ltr"><br>
El 27/6/2015 20:23, "Ville Voutilainen" <<a href=3D"mailto:vil=
le.voutilainen@gmail.com">ville.voutilainen@gmail.com</a>> escribi=C3=B3=
:<br>
><br>
> On 28 June 2015 at 01:56, Matthew Fioravante <<a href=3D"mailto:fma=
tthew5876@gmail.com">fmatthew5876@gmail.com</a>> wrote:<br>
> > I've started a paper here:<br>
> > <a href=3D"https://github.com/fmatthew5876/stdcxx-lambda-init/blo=
b/master/proposal/draft.md">https://github.com/fmatthew5876/stdcxx-lambda-i=
nit/blob/master/proposal/draft.md</a><br>
><br>
> I find that you might be able to support aggregates, by using a techni=
que<br>
> similar to the one described in this paper:<br>
> <a href=3D"http://open-std.org/JTC1/SC22/WG21/docs/papers/2015/n4462.h=
tml">http://open-std.org/JTC1/SC22/WG21/docs/papers/2015/n4462.html</a></p>
<p dir=3D"ltr">This was pre-lambdas of course: <a href=3D"http://www.open-s=
td.org/jtc1/sc22/wg21/docs/papers/2003/n1467.pdf">http://www.open-std.org/j=
tc1/sc22/wg21/docs/papers/2003/n1467.pdf</a></p>
<p dir=3D"ltr">Two things from my jurassic paper may be useful: 1) the argu=
ment telling the indices (tuple?) of the element being constructed, 2) make=
it useful for multidimensional arrays<br></p>
<p dir=3D"ltr">><br>
> --<br>
><br>
> ---<br>
> You received this message because you are subscribed to the Google Gro=
ups "ISO C++ Standard - Future Proposals" group.<br>
> To unsubscribe from this group and stop receiving emails from it, send=
an email to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org">std-=
proposals+unsubscribe@isocpp.org</a>.<br>
> To post to this group, send email to <a href=3D"mailto:std-proposals@i=
socpp.org">std-proposals@isocpp.org</a>.<br>
> Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/g=
roup/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-propos=
als/</a>.<br>
</p>
<p></p>
-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
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 />
--001a1141ca82633d6f0519926565--
.