[Libxmlplusplus-general] const std::string& return types.



I am very uncomfortable with function signatures such as this:
const std::string& Node::name() const;

because
a) It is untargetted optimisation, and it's too early for that.
b) It makes orphaned references possible.
c) std::string can be implemented with reference-counting to make
copying more efficient - I believe that newer versions of libstdc++ do
this.

Christophe, if you agree then I will change all these methods to look
like this instead:
std::string get_name() const;

-- 
Murray Cumming
murray usa net
www.murrayc.com





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