Possible way to achieve lazy loading with const objects
Christophe
travert at phare.normalesup.org
Fri Sep 30 07:53:50 PDT 2011
> What I think we need is to make the free function opEquals a template,
> which only instantiates for objects, and then the lhs.opEquals(rhs) and
> rhs.opEquals(lhs) will take full advantage of any overloaded opEquals.
>
> For example, if you wanted to overload for non-const objects. But I think
> the default in Object should be const.
Thanks for the explanation.
That seems to be a nice solution to me.
(some people might complain of template bloat...)
More information about the Digitalmars-d
mailing list