diff options
author | Brad King <brad.king@kitware.com> | 2014-01-27 18:03:40 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-01-27 18:03:40 (GMT) |
commit | 93ddb26311d91df267d0ff1c2e93aabeff32165b (patch) | |
tree | d2ff514f9a13d9f170ec8a00670dec47e14f25ca | |
parent | ddb792daab4816b0fc01f672737835a072d7c5ee (diff) | |
parent | ed632736e380553866a1e6edde3767c067819b6f (diff) | |
download | CMake-93ddb26311d91df267d0ff1c2e93aabeff32165b.zip CMake-93ddb26311d91df267d0ff1c2e93aabeff32165b.tar.gz CMake-93ddb26311d91df267d0ff1c2e93aabeff32165b.tar.bz2 |
Merge topic 'disallowed-cxx-subset'
ed632736 Help: Note that std::string::clear may not be used.
cc04bb6c Help: Document non-use of std::set::insert.
-rw-r--r-- | Help/manual/cmake-developer.7.rst | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index d5fbc98..d169e1a 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 ------------------------ @@ -124,6 +126,29 @@ A loop must be used instead: theVector.push_back(*li); } +std::set::insert +---------------- + +Use of ``std::set::insert`` is not allowed with any source container: + +.. code-block:: c++ + + std::set<cmTarget*> theSet; + theSet.insert(targets.begin(), targets.end()); // Wrong + +A loop must be used instead: + +.. code-block:: c++ + + ConstIterator it = targets.begin(); + const ConstIterator end = targets.end(); + for ( ; it != end; ++it) + { + theSet.insert(*it); + } + +.. MSVC6, SunCC 5.9 + Template Parameter Defaults --------------------------- |