Why isn't std.exception.assumeUnique
generically defined as
auto assumeUnique(T)(T x) @trusted {
return cast(immutable)x;
}
instead of currently restricted to arrays at https://github.com/dlang/phobos/blob/master/std/exception.d#L905?
Thread overview | |||||
---|---|---|---|---|---|
|
May 05, 2022 Generic assumeUnique | ||||
---|---|---|---|---|
| ||||
Why isn't
instead of currently restricted to arrays at https://github.com/dlang/phobos/blob/master/std/exception.d#L905? |
May 05, 2022 Re: Generic assumeUnique | ||||
---|---|---|---|---|
| ||||
Posted in reply to Per Nordlöw | On Thursday, 5 May 2022 at 08:15:35 UTC, Per Nordlöw wrote: >Why isn't
That's not a correct use of instead of currently restricted to arrays at https://github.com/dlang/phobos/blob/master/std/exception.d#L905? The documentation says: >Typically, For a |
May 05, 2022 Re: Generic assumeUnique | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dennis | On Thursday, 5 May 2022 at 12:32:07 UTC, Dennis wrote: >What non-array type do you want to use http://mir-algorithm.libmir.org/mir_string_map.html I can use
|