http://d.puremagic.com/issues/show_bug.cgi?id=9501
Jonathan M Davis <jmdavisProg gmx.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jmdavisProg gmx.com
--- Comment #1 from Jonathan M Davis <jmdavisProg gmx.com> 2013-02-12 17:54:43
PST ---
Yes, std.mmfile.MmFile should be a struct. It doesn't use polymorphism and has
no need to be a class. But making it a struct would break all code that uses
it, so we're arguably stuck with it being the way that it is.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Yes, std.mmfile.MmFile should be a struct. It doesn't use polymorphism and has
no need to be a class.

And maybe it doesn't have an explicit close() method, I don't know why, maybe
for safety in accessing the memory mapped bytes.

But making it a struct would break all code that uses
it, so we're arguably stuck with it being the way that it is.

There are always acceptable deprecation paths, if we want them. Like adding the
struct to std.mmfile with another name ("RcMmFile"?) and deprecating
std.mmfile.MmFile for two years.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

http://d.puremagic.com/issues/show_bug.cgi?id=9501
--- Comment #3 from bearophile_hugs eml.cc 2013-02-12 20:05:43 PST ---
Mostly unrelated, about std.mmfile: I think in the std.mmfile module this line
(line 270) should offer a string message too when the file is not found:
errnoEnforce(false);
And I think switches like this one should become "final":
switch (mode)
{
case Mode.read:
...
default:
assert(0);
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------