diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-01-24 14:44:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-01-27 18:02:59 (GMT) |
commit | cc04bb6c16fba66b8d73807d5e4a397d6450a6b7 (patch) | |
tree | 6ce5346a45fcd74f7e873b206af3f80e5f8d1cbb /Help | |
parent | 0183ede2ccd2fb96bc781c1e26999ced3588cf60 (diff) | |
download | CMake-cc04bb6c16fba66b8d73807d5e4a397d6450a6b7.zip CMake-cc04bb6c16fba66b8d73807d5e4a397d6450a6b7.tar.gz CMake-cc04bb6c16fba66b8d73807d5e4a397d6450a6b7.tar.bz2 |
Help: Document non-use of std::set::insert.
As found in commit 8e7c207e (Use a manual loop to insert into
set::set., 2012-09-15).
Diffstat (limited to 'Help')
-rw-r--r-- | Help/manual/cmake-developer.7.rst | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst index d5fbc98..8df2ca1 100644 --- a/Help/manual/cmake-developer.7.rst +++ b/Help/manual/cmake-developer.7.rst @@ -124,6 +124,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 --------------------------- |