definition save method in phobos library on 2016-03-30
image/png
4346
Comments
Comment #0 by rogonovstepan — 2016-03-30T18:59:27Z
Created attachment 1593
definition save method in phobos library on 2016-03-30
can't call save method for immutable Mt19937.
this method must be immutable because it possible to create mutable copy of immutable object
Comment #1 by rogonovstepan — 2016-03-30T19:02:53Z
Possible solution(IMHO):
@property typeof(this) save() @safe pure nothrow immutable
{
return this;
}
Comment #2 by hsteoh — 2016-03-31T17:52:37Z
It's sufficient to make .save const.
Comment #3 by rogonovstepan — 2016-04-01T07:12:42Z
(In reply to hsteoh from comment #2)
> It's sufficient to make .save const.
I agree with you. I am just beginner in dlanguage ^_^
I hope someone, who developed this library, assigned this issue as soon as possible!
Comment #4 by petar.p.kirov — 2016-04-01T15:09:55Z
dlang/phobos pull request #6857 "[Revival of PR 4136] Fix issue 15853 - std.random save methods must be const" was merged:
https://github.com/dlang/phobos/pull/6857