From ed632736e380553866a1e6edde3767c067819b6f Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 24 Jan 2014 15:46:31 +0100 Subject: [PATCH] Help: Note that std::string::clear may not be used. As found in commit 519c0a5d (Can't use std::string::clear() in cmake., 2012-09-15). --- Help/manual/cmake-developer.7.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index 8df2ca1cd..d169e1ae5 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -33,17 +33,19 @@ The ``at()`` member function of ``std::vector`` may not be used. Use int i1 = someVec.at(5); // Wrong int i2 = someVec[5]; // Ok -std::string::append -------------------- +std::string::append and std::string::clear +------------------------------------------ -The ``append()`` member function of ``std::string`` may not be used. Use -``operator+=`` instead: +The ``append()`` and ``clear()`` member functions of ``std::string`` may not +be used. Use ``operator+=`` and ``operator=`` instead: .. code-block:: c++ std::string stringBuilder; stringBuilder.append("chunk"); // Wrong + stringBuilder.clear(); // Wrong stringBuilder += "chunk"; // Ok + stringBuilder = ""; // Ok std::set const iterators ------------------------