[bind10-dev] Name::reverse()?

Shane Kerr shane at isc.org
Fri Feb 19 15:50:46 UTC 2010


Jinmei,

On Fri, 2010-02-19 at 02:16 -0800, JINMEI Tatuya / 神明達哉 wrote:
> Second, In some cases, we may still want to have relatively minor
> functionality in the public library.  But especially for minor usage,
> I basically think we should avoid adding class member functions so
> that we won't make the class too monolithic.

I don't see anything wrong with including this in the public library.

I also tend to accept the wisdom in _Effective C++_ which says that you
shouldn't make functions class functions unless they need to access
private data:

        27. Functions that can be implemented using a class' public
        interface should not be members.

Michael disagrees, but I think he comes from a relatively purist
object-oriented point of view, where everything is attached to an
object, because... well, everything is attached to an object. :)

However, both Evan's and your implementation access private data from
the class, which seems to argue that the reverse() method *does* need to
be a member function. If this is strictly an efficiency issue, then
probably it makes sense to try it as a non-member function first, and
then move it into the class if benchmarking indicates that it is
important.

--
Shane




More information about the bind10-dev mailing list