Quellcode durchsuchen

Help: Remove documented restriction on find in conditions.

The necessary conversion is supported by all CMake host compilers.
Stephen Kelly vor 10 Jahren
Ursprung
Commit
ac3d382920
2 geänderte Dateien mit 1 neuen und 29 gelöschten Zeilen
  1. 0 26
      Help/manual/cmake-developer.7.rst
  2. 1 3
      Source/cmGeneratorExpressionDAGChecker.cxx

+ 0 - 26
Help/manual/cmake-developer.7.rst

@@ -21,32 +21,6 @@ CMake is required to build with ancient C++ compilers and standard library
 implementations.  Some common C++ constructs may not be used in CMake in order
 to build with such toolchains.
 
-std::set const iterators
-------------------------
-
-The ``find()`` member function of a ``const`` ``std::set`` instance may not be
-used in a comparison with the iterator returned by ``end()``:
-
-.. code-block:: c++
-
-  const std::set<std::string>& someSet = getSet();
-  if (someSet.find("needle") == someSet.end()) // Wrong
-    {
-    // ...
-    }
-
-The return value of ``find()`` must be assigned to an intermediate
-``const_iterator`` for comparison:
-
-.. code-block:: c++
-
-  const std::set<std::string>& someSet;
-  const std::set<std::string>::const_iterator i = someSet.find("needle");
-  if (i != propSet.end()) // Ok
-    {
-    // ...
-    }
-
 std::auto_ptr
 -------------
 

+ 1 - 3
Source/cmGeneratorExpressionDAGChecker.cxx

@@ -66,9 +66,7 @@ cmGeneratorExpressionDAGChecker::Initialize()
     if (it != top->Seen.end())
       {
       const std::set<std::string> &propSet = it->second;
-      const std::set<std::string>::const_iterator i
-          = propSet.find(this->Property);
-      if (i != propSet.end())
+      if (propSet.find(this->Property) != propSet.end())
         {
         this->CheckResult = ALREADY_SEEN;
         return;