[Cmake-commits] CMake branch, next, updated. v3.1.0-1494-g4d0a5c0

Stephen Kelly steveire at gmail.com
Sun Jan 4 11:03:24 EST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  4d0a5c05cec02e9b0ed8987621ae3a4f6a3b2428 (commit)
       via  66c9ae6c7ea88dc65c5923d124970bf8cd6c4f3b (commit)
       via  abaffb10fb67e3e16937518b307215f44da01051 (commit)
      from  1ec61b9ae1e107567553ee4fd799a41fb266735a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4d0a5c05cec02e9b0ed8987621ae3a4f6a3b2428
commit 4d0a5c05cec02e9b0ed8987621ae3a4f6a3b2428
Merge: 1ec61b9 66c9ae6
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jan 4 11:03:24 2015 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jan 4 11:03:24 2015 -0500

    Merge topic 'delete-algorithm' into next
    
    66c9ae6c Use the cmDeleteAll algorithm for types derived from std::map.
    abaffb10 cmDeleteAll: Generalize deletion specialization for map types.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=66c9ae6c7ea88dc65c5923d124970bf8cd6c4f3b
commit 66c9ae6c7ea88dc65c5923d124970bf8cd6c4f3b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jan 4 15:06:37 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jan 4 17:03:06 2015 +0100

    Use the cmDeleteAll algorithm for types derived from std::map.

diff --git a/Source/cmExportSetMap.cxx b/Source/cmExportSetMap.cxx
index 5174118..14c4458 100644
--- a/Source/cmExportSetMap.cxx
+++ b/Source/cmExportSetMap.cxx
@@ -25,12 +25,7 @@ cmExportSet* cmExportSetMap::operator[](const std::string &name)
 
 void cmExportSetMap::clear()
 {
-  for(std::map<std::string, cmExportSet*>::iterator it = this->begin();
-      it != this->end();
-      ++ it)
-    {
-    delete it->second;
-    }
+  cmDeleteAll(*this);
   this->derived::clear();
 }
 
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 721c2ab..1549322 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1510,11 +1510,7 @@ void cmGlobalGenerator::CreateGeneratorTargets()
 //----------------------------------------------------------------------------
 void cmGlobalGenerator::ClearGeneratorMembers()
 {
-  for(cmGeneratorTargetsType::iterator i = this->GeneratorTargets.begin();
-      i != this->GeneratorTargets.end(); ++i)
-    {
-    delete i->second;
-    }
+  cmDeleteAll(this->GeneratorTargets);
   this->GeneratorTargets.clear();
 
   cmDeleteAll(this->EvaluationFiles);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3f09b9e..0eb47a9 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -542,12 +542,7 @@ void cmTarget::ClearLinkMaps()
   this->Internal->LinkInterfaceMap.clear();
   this->Internal->LinkInterfaceUsageRequirementsOnlyMap.clear();
   this->Internal->LinkClosureMap.clear();
-  for (cmTargetLinkInformationMap::const_iterator it
-      = this->LinkInformation.begin();
-      it != this->LinkInformation.end(); ++it)
-    {
-    delete it->second;
-    }
+  cmDeleteAll(this->LinkInformation);
   this->LinkInformation.clear();
 }
 
@@ -6913,10 +6908,7 @@ cmTargetLinkInformationMap
 //----------------------------------------------------------------------------
 cmTargetLinkInformationMap::~cmTargetLinkInformationMap()
 {
-  for(derived::iterator i = this->begin(); i != this->end(); ++i)
-    {
-    delete i->second;
-    }
+  cmDeleteAll(*this);
 }
 
 //----------------------------------------------------------------------------

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=abaffb10fb67e3e16937518b307215f44da01051
commit abaffb10fb67e3e16937518b307215f44da01051
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jan 4 15:16:56 2015 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jan 4 17:03:05 2015 +0100

    cmDeleteAll: Generalize deletion specialization for map types.
    
    Assume that a container whose const_iterator to a container which
    has a value_type which in turn has a second_type should have the
    second member deleted.
    
    Use a C++17-style voider to implement the type introspection.

diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h
index 853413d..4e846e6 100644
--- a/Source/cmStandardIncludes.h
+++ b/Source/cmStandardIncludes.h
@@ -448,7 +448,22 @@ private:
 
 namespace ContainerAlgorithms {
 
-template<typename Container>
+template<typename> struct voider { typedef void type; };
+
+template<typename T, typename = void>
+struct HasSecondType
+{
+  enum { value = false };
+};
+
+template<typename T>
+struct HasSecondType<T, typename voider<typename T::second_type>::type>
+{
+  enum { value = true };
+};
+
+template<typename Container,
+    bool hasSecondType = HasSecondType<typename Container::value_type>::value>
 struct DefaultDeleter
 {
   void operator()(typename Container::value_type value) {
@@ -456,10 +471,10 @@ struct DefaultDeleter
   }
 };
 
-template<typename K, typename V>
-struct DefaultDeleter<std::map<K, V> >
+template<typename Container>
+struct DefaultDeleter<Container, /* hasSecondType = */ true>
 {
-  void operator()(typename std::map<K, V>::value_type value) {
+  void operator()(typename Container::value_type value) {
     delete value.second;
   }
 };

-----------------------------------------------------------------------

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list