When working with C-libraries in D I often wish for a equivalent of the
C++11 unique_ptr. Unfortunately this is not possible in D. Consider the
following source code:
http://dpaste.dzfl.pl/6e71c815
Is error 1 a bug? Because there should cleary not be any copy at this point.
Should we implemen
On Sunday, 22 December 2013 at 13:19:48 UTC, Benjamin Thaut wrote:
When working with C-libraries in D I often wish for a
equivalent of the C++11 unique_ptr. Unfortunately this is not
possible in D. Consider the following source code:
http://dpaste.dzfl.pl/6e71c815
Is error 1 a bug? Because th
Am 22.12.2013 14:24, schrieb Kelet:
On Sunday, 22 December 2013 at 13:19:48 UTC, Benjamin Thaut wrote:
When working with C-libraries in D I often wish for a equivalent of
the C++11 unique_ptr. Unfortunately this is not possible in D.
Consider the following source code:
http://dpaste.dzfl.pl/6e7
I also just noticed that std.typecons.Unique does not disable the copy
constructor. That doesn't seem very safe to me. The source code for it
is also littered with tons of "Doens't work yet" comments.
On Sunday, 22 December 2013 at 13:28:05 UTC, Benjamin Thaut wrote:
Well yes, but I'm more interrested in moving around the
ownership between functions, which works in c++11 because of
the move semantics they implemented. This doesn't work in D for
the shown reasons.
http://dpaste.dzfl.pl/d1a6
Am 22.12.2013 14:36, schrieb Sergei Nosov:
On Sunday, 22 December 2013 at 13:28:05 UTC, Benjamin Thaut wrote:
Well yes, but I'm more interrested in moving around the ownership
between functions, which works in c++11 because of the move semantics
they implemented. This doesn't work in D for the s
On 12/22/2013 02:36 PM, Sergei Nosov wrote:
On Sunday, 22 December 2013 at 13:28:05 UTC, Benjamin Thaut wrote:
Well yes, but I'm more interrested in moving around the ownership
between functions, which works in c++11 because of the move semantics
they implemented. This doesn't work in D for the
On 12/22/2013 02:19 PM, Benjamin Thaut wrote:
When working with C-libraries in D I often wish for a equivalent of the
C++11 unique_ptr. Unfortunately this is not possible in D. Consider the
following source code:
http://dpaste.dzfl.pl/6e71c815
Is error 1 a bug? Because there should cleary not b
On 12/22/2013 03:13 PM, Timon Gehr wrote:
Is error 1 a bug? Because there should cleary not be any copy at this
point.
...
I don't think the conditions when a struct is moved are actually
documented beyond the NRVO case. I think it ideally would be a bug, but
this would require some kind of DI
On 12/22/2013 03:19 PM, Timon Gehr wrote:
On 12/22/2013 03:13 PM, Timon Gehr wrote:
Is error 1 a bug? Because there should cleary not be any copy at this
point.
...
I don't think the conditions when a struct is moved are actually
documented beyond the NRVO case. I think it ideally would be a
On Sunday, 22 December 2013 at 13:40:30 UTC, Benjamin Thaut wrote:
Uh, this looks a lot better then std.typecons.Unique
Did you try doing a pull request to replace std.typecons.Unique
with your implementation?
No, I didn't.
I'm kind of thinking, that the "unique" concept currently can't
be fu
11 matches
Mail list logo