[sword-devel] sword::ListKey::Count() and sword::ListKey::GetElement() constness

Troy A. Griffitts scribe at crosswire.org
Fri Jul 5 18:46:23 MST 2013


Hi Jaak,

You're only partially correct.  GetElement returns a non-const pointer 
to a container member.  This method should not be made const.  Count 
should be const.

Working toward 2.0, we've been normalizing method names and deprecating 
the old methods.  We have not yet normalized ListKey. When we do, I will 
be sure to make getCount() const and provide both a const and non-const 
getElement.  Thanks for the heads up.

On 07/05/2013 10:26 PM, Jaak Ristioja wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi!
>
> I think sword::ListKey::Count() and sword::ListKey::GetElement()
> should be declared const. We have several places in BibleTime's source
> code where we just const_cast to work around this bug. Should be
> relatively easy to fix afaik.
>
> Blessings,
> Jaak
>
> PS: Will a fix for this be included in the next version of Sword?
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.20 (GNU/Linux)
>
> iQgcBAEBAgAGBQJR1yvhAAoJEEqsYmEt1rCOq8U//1hwvssIVG1wMYWSA7cZ5nkj
> cfxJPfG34CN8YTuBxOEh1M0QzBcvv4jyZE9Vk4/67fWud6Kpe8ByZu6Y1UI/+aVe
> o58QQ4nJNxwYC/x4Svh1E7D4Cb/vdPLqtj5ZNoUZK4EwzEEu3OE25ZcznuQq0Sge
> Eir3zVeqhT7OCLv7zxvQkwY9+xZKacwu/rSropGuo2O6wfR6FnpRs/CYZT0BEos2
> ltoEXxtNZBgtjC09WdtofjFx+ZYg/22/mR55Ic+oYUA2RrQTKr4v21nHHNQVLIWY
> Z/5fH+9eAYHtpieKRht/9jtR1pIB6INQuwOE2FOzqGvKNRzizMsWeNd20gUf0yoK
> VbdQRM7h96plor0Te5MgxM6NSdt+xSiRHrog0T3DJj9Uaf5Q5psR+0JZW7SY9sc4
> MIP6civitHkorx2xFg6Vi+9Pb7YcRPBWQYxhAePRgdOf2u5r6SbWw3ObG5B8WRaX
> k1sLuiPnk06sE1Rm3cwwc5AukaGakFAZZrVuCnEuSAI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exOPKWTdS0dmIl4uL6xPBOtfZw11dExcztqP
> iWnpO6OBMNZ/49L3N2iXPUJOuuq9pYe635WXLxpL5pbcNLQV1teHxjjtQ1jvNuJ/
> yd4j/iL3zLKsYMbUgBDg
> =68Yv
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page




More information about the sword-devel mailing list