Am 24.10.2017 um 16:25 schrieb Steven Schveighoffer:
On 10/24/17 4:45 AM, Sönke Ludwig wrote:
On Tue, 24 Oct 2017 07:21:15 GMT, Alexey Kulentsov wrote:
On Mon, 23 Oct 2017 23:05:42 GMT, Sönke Ludwig wrote:
void fn(const Task task) { ... taskIdToStore = task.tid.toString; .... }
and can't because of 'mutable method vibe.core.task.Task.tid is not
callable using a const object'The method itself can be made
inout
, but the problem is that,
AFAICS, aconst(Tid)
isn't usable for sending or receiving
messages either.
Yes, I understand. But it still can be useful if I want only to
collect tasks ID's to use it in another place.Added:
https://github.com/vibe-d/vibe.d/commit/c50c962748e4ec6d62cfa532fa0a03827bbfcd5dhttps://github.com/vibe-d/vibe-core/commit/874e174d38be6520f301453f75e4660dc5b158c3
inout should have been used, much cleaner IMO.
https://github.com/vibe-d/vibe.d/pull/1962
https://github.com/vibe-d/vibe-core/pull/38-Steve
The problem is that inout
also matches immutable
, so that the
ternary operator deduces the expression type to const
instead of inout
(because the static variable is mutable).