Vladimir Prus <[EMAIL PROTECTED]> writes: | Lars Gullik Bj?nnes wrote: > >> | I'm not sure I understand the separation argument -- the extra >> | forwarding layer just adds complexity (e.g. your change to inMatched() >> | in insets/insetbase.h just double the number of characters ;-) ), but >> | anyway... >> >> For a grand total of _one_ line. > | :-) One line here, one line there, and the final total might be larger. In | the worst case, you have on private method for each public method which | doubles the size of the entire class declaration.
But only the base class... > >> | I always though the point about NVI is that you can add >> | pre-processing/post-processing before calling the virtual function. At >> | least that what I've heard -- I never needed to add such pre/post >> | processing. >> >> That is also an argument. If you look at dispatch/doDispatch in >> InsetBase you see that we use this. > | BTW, I also believe NVI is not necessary for pure virtual functions (like | 'clone' in insetbase.h). They are really part of the interface. NVI is being used by the C++ Standard library (look at the iostreams), and touted as "best practice", not only by Herb Sutter, but also by Scott Meyers. It is not like Herb Sutter has conjured this out of thin air. And no, I do not agree that they "are really part of the interface". Sure they are part of the implementors or the re-implementors interface, but not of the users interface. And this is wht NVI is separating. -- Lgb