Re: [libxml++] Re: [Libxmlplusplus-general] Adding STL-container-like methods to Node instead of returning a container instance



Jonathan Wakely wrote:

Element *element = ...;
my_function(element->children_begin(), element->children_end());

which is rather elegant and intuitive (and consistent with STL),
don't you think ?


No. It is not consistent with the STL. The STL clearly defines names for
required methods, so it should be begin() not children_begin().
If the interface conforms to one of the STL concepts then the names
should match to indicate as much. A STL-savvy user who reads something
saying "The libxml++ Document is a model of an STL Forward Container"
will asusme they can write code using the "begin()" method.

it's not the container itself that is 'standard compliant'.
But the iterators it returns are.

Stefan







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]