Smart pointers instead of GC?

Meta jared771 at gmail.com
Tue Feb 4 18:44:21 PST 2014


On Wednesday, 5 February 2014 at 00:50:55 UTC, Walter Bright 
wrote:
> On 2/4/2014 4:07 PM, Frank Bauer wrote:
>> Regarding different pointer types in Rust as function 
>> arguments:
>>
>> A function that takes a borrowed pointer &T can also be called 
>> with an owning
>> pointer ~T, an RC pointer Rc<T>, or a GC pointer Gc<T>. They 
>> all convert neatly
>> to a &T. One function to rule them ... err .. accomodate all.
>
> Again, what happens with:
>
>     T identity(T t) { return t; }
>
> ? I.e. the transference of the argument pointer type to the 
> return type?

The compiler already infers @safe nothrow pure on template 
functions. Couldn't it do the same for @nullable?


More information about the Digitalmars-d mailing list