On 7/9/2012 3:27 PM, Jakob Ovrum wrote:
This opEquals is only logically constant, not bitwise constant, hence it must not be const; similar to the caching scenario. Just trying to demonstrate that the issue is bigger than just caching - it's any logically constant comparison function.
I understand, but the downside of not making these functions const is it will torpedo the use of functional style programming in D.
A straightforward workaround is to use PIMPL to encapsulate the logical const stuff, and then cast the reference to const to use inside the opEquals.