Purity, @safety, etc., in generic code

deadalnix deadalnix at gmail.com
Mon Feb 18 22:58:37 PST 2013


On Monday, 18 February 2013 at 07:46:24 UTC, kenji hara wrote:
> I think const must not be inferred for member function, because 
> it affects
> to the function overloading. For example, the const-ness for 
> class method
> will be inferred from base class overridden method with current 
> compiler,
> but it causes a serious problem.
>
> http://d.puremagic.com/issues/show_bug.cgi?id=8366
>
> Instead, you should declare two methods in generic code - one 
> is mutable,
> and another is const/inout.
>

I remember mentioning overloading on const as a bad idea in the 
past. I don't really see the point of it.


More information about the Digitalmars-d mailing list