On Wednesday, 3 January 2018 at 08:51:55 UTC, Simen Kjærås wrote:
On Saturday, 30 December 2017 at 03:49:37 UTC, ChangLong wrote:
What I am try to do is implement a unique data type. (the
ownership auto moved into new handle)
Have you considered std.typecons.Unique[0]? If yes, in what
ways
On Saturday, 30 December 2017 at 03:49:37 UTC, ChangLong wrote:
What I am try to do is implement a unique data type. (the
ownership auto moved into new handle)
Have you considered std.typecons.Unique[0]? If yes, in what ways
does it not cover your needs?
Your example code written with
On 12/29/2017 07:49 PM, ChangLong wrote:
On Wednesday, 20 December 2017 at 18:43:21 UTC, Ali Çehreli wrote:
Thanks to Mengü for linking to that section. I have to make
corrections below.
Ali
Thanks for explain, Ali And Mengu.
What I am try to do is implement a unique data type. (the
On Wednesday, 20 December 2017 at 18:43:21 UTC, Ali Çehreli wrote:
Thanks to Mengü for linking to that section. I have to make
corrections below.
Ali
Thanks for explain, Ali And Mengu.
What I am try to do is implement a unique data type. (the
ownership auto moved into new handle)
Thanks to Mengü for linking to that section. I have to make corrections
below.
On 12/20/2017 10:04 AM, Ali Çehreli wrote:
> 'auto ref' essentially generates two copies of the function: one taking
> by-value for rvalues
Note that by-value for rvalues means "blitting" in D (blit: bit-level
On Wednesday, 20 December 2017 at 18:04:57 UTC, Ali Çehreli wrote:
On 12/20/2017 07:02 AM, ChangLong wrote:
> [...]
is not
> [...]
The problem is not with opAssign but with left(), which returns
an rvalue. It's by design that rvalues cannot be bound to
references in D.
[...]
was just
On 12/20/2017 07:02 AM, ChangLong wrote:
> ===
> struct A {
> alias This= typeof(this) ;
>
> void opAssign(ref This ){
> }
>
> ref auto left(){
> return This() ;
> }
> }
>
> void main(){
> Aroot ;
> ref find() {
>
===
struct A {
alias This = typeof(this) ;
void opAssign(ref This ){
}
ref auto left(){
return This() ;
}
}
void main(){
A root ;