J
James Kanze
On 6 Jul. Daniel wrote:
[...]
So the interface says that your Cost Functor should stay constant when
being used, IOW using it should no change its internal state. I can't
imagine what the rationale behind this decision should be, but maybe
there _is_ a quite good reason.
This looks very much like a callback, to be passed by reference
to some other function. One possible reason why the function is
const is that the author of the other function wanted to support
using a temporary object as an argument (and it didn't occur to
him that someone might need a mutable functional object).