[Libxmlplusplus-general] const std::string& return types.
- From: murrayc t-online de (Murray Cumming)
- To: libxml++ <libxmlplusplus-general lists sourceforge net>
- Subject: [Libxmlplusplus-general] const std::string& return types.
- Date: 15 Nov 2002 14:29:04 +0100
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]