Re: Smart references

2015-03-15 Thread Zach the Mystic via Digitalmars-d
On Saturday, 14 March 2015 at 15:55:51 UTC, Marc Schütz wrote: Are the suggested changes also related to the possibility of making `ref` a type? Are there plans to do this? I remember Walter suggested `ref` for non-parameters, i.e. local variables, but as a storage class, not a type

Re: Smart references

2015-03-14 Thread via Digitalmars-d
On Friday, 13 March 2015 at 15:21:42 UTC, Zach the Mystic wrote: On Wednesday, 11 March 2015 at 20:33:07 UTC, Andrei Alexandrescu wrote: I'm investigating D's ability to define and use smart references. Per the skeleton at http://dpaste.dzfl.pl/9d752b1e9b4e, lines: #6: You can't default

Re: Smart references

2015-03-13 Thread Zach the Mystic via Digitalmars-d
On Wednesday, 11 March 2015 at 20:33:07 UTC, Andrei Alexandrescu wrote: I'm investigating D's ability to define and use smart references. Per the skeleton at http://dpaste.dzfl.pl/9d752b1e9b4e, lines: #6: You can't default-initialize a ref. #7: You can't copy a ref - copying should mean

Re: Smart references

2015-03-12 Thread via Digitalmars-d
On Wednesday, 11 March 2015 at 20:33:07 UTC, Andrei Alexandrescu wrote: #70: Attempting to copy a reference fails on account of the disabled postblit. There should be a way to tell the compiler to automatically invoke alias this and create a copy of that guy. #81: Moving from a reference

Smart references

2015-03-11 Thread Andrei Alexandrescu via Digitalmars-d
I'm investigating D's ability to define and use smart references. Per the skeleton at http://dpaste.dzfl.pl/9d752b1e9b4e, lines: #6: You can't default-initialize a ref. #7: You can't copy a ref - copying should mean copying the object itself. #9: Per this example I'm hooking a reference

Re: Smart references

2015-03-11 Thread Rikki Cattermole via Digitalmars-d
On 12/03/2015 9:33 a.m., Andrei Alexandrescu wrote: I'm investigating D's ability to define and use smart references. Per the skeleton at http://dpaste.dzfl.pl/9d752b1e9b4e, lines: #6: You can't default-initialize a ref. #7: You can't copy a ref - copying should mean copying the object itself

Re: Smart references

2015-03-11 Thread Meta via Digitalmars-d
On Thursday, 12 March 2015 at 04:03:44 UTC, Rikki Cattermole wrote: Of course this would break wards compatibility a little bit, so maybe a pragma to tell the compiler to include int in ==? pragma(aliasIsThis) struct Ref(T, Owner) { ... That's not good enough. It'll still fail template