[sword-devel] Sword for BPBible 1.5.12

Matthew Talbert ransom1982 at gmail.com
Tue Apr 7 00:35:51 MST 2009


>>    const is important in public interface methods to advertise to the
>>    consumer what our contract is.  For example, if we have a method like:
>>
>>    doSomething(const SWModule *) {
>>    }
>>
>>    we are guaranteeing to the caller that we will not modify the
>>    SWModule.  Unless hasEntry is defined as const, then we will get a
>>    compile error inside doSomething if we try to call mod->hasEntry()
>>
>>    We can cache.  the mutable keyword is used in C++ to tell the
>>    compiler that we are allowed to change this class member even in a
>>    const method.
>>
>> OK, I didn't realise that. I tried setting it to const, and it didn't work, so I gave up with it. If you can get it working, that's good. But the commit that you did for linkEntry broke for at least Matthew and me - it may behave differently for different compilers.

There was a compile error at some revision dealing with const (but I
believe const was being used in function arguments perhaps??). At any
rate, that problem is gone, for me at least.

Matthew



More information about the sword-devel mailing list