Generic assumeUnique

Per Nordlöw per.nordlow at gmail.com
Thu May 5 08:15:35 UTC 2022


Why isn't `std.exception.assumeUnique` generically defined as

```d
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?


More information about the Digitalmars-d mailing list