* Tinny Ng <[EMAIL PROTECTED]> [2002-12-13 16:35]:
> I think we need to think again about this, as it's not only
> "createTreeWalker", the DOM document has all those createXXXX methods like
> "createElement", "createAtttribute" ..., and then all those inherited
> DOMNode interface like "removeChild", "replaceChild" ...etc.
[...]
Tinny,
I don't think that a pair of member functions would have to
be created for each operation. For example, there might be
member functions which indeed modify the DOM document (e.g.
the create/remove functions are good candidates). For these,
it is not necessary to create a "const" variant. For others,
(e.g. the tree walker), it's good to have both the const
and the non-const variant so that you can have a constant
DOM document and walk through it using only const member
functions.
IMHO, the decision when to have
1) only a non-const variant
2) only a const variant
3) both variants
of member functions would have to be done on a case-by-case
basis (depending on if the member function might change the
document *logically* - i.e. the object changes visibly to
the caller).
You might be interested in the recent thread titled "is const
correctness a dogma" in comp.lang.c++.moderated.
Regards
Ingolf
--
Ingolf Steinbach Jena-Optronik GmbH
[EMAIL PROTECTED] ++49 3641 200-147
PGP: 0x7B3B5661 213C 828E 0C92 16B5 05D0 4D5B A324 EC04
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]