On Tuesday, 6 February 2018 at 23:15:07 UTC, Timothee Cour wrote:
Like assumeUnique?
https://dlang.org/library/std/exception/assume_unique.html

what do you mean? u mean adding "unique" to the DSL list ? maybe!


You asked: Actually how about introducing a library solution for explicit casting.
That's why I thought about the existing assumeUnique:


```
immutable(T)[] assumeUnique(T)(ref T[] array) pure nothrow
{
    auto result = cast(immutable(T)[]) array;
    array = null;
    return result;
}
```

https://github.com/dlang/phobos/blob/v2.078.1/std/exception.d#L905

Reply via email to