Bug 15853 – std.random save methods must be const

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-03-30T18:59:27Z
Last change time
2019-02-16T06:25:17Z
Keywords
pull
Assigned to
ZombineDev
Creator
Stepan Rogonov

Attachments

IDFilenameSummaryContent-TypeSize
1593Capture.PNGdefinition save method in phobos library on 2016-03-30image/png4346

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
Comment #5 by rogonovstepan — 2016-04-01T18:07:01Z
(In reply to ZombineDev from comment #4) > PR: https://github.com/D-Programming-Language/phobos/pull/4136 Thank you for fix! It's good news for me. I close this issue.
Comment #6 by hsteoh — 2016-04-01T18:08:41Z
Let's not close it until the PR is merged.
Comment #7 by rogonovstepan — 2016-04-01T18:16:52Z
(In reply to hsteoh from comment #6) > Let's not close it until the PR is merged. Sorry..
Comment #8 by n8sh.secondary — 2019-02-08T22:03:34Z
Comment #9 by dlang-bot — 2019-02-16T06:25:17Z
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