Index: code/branches/cpp11_v3/src/libraries/core/ClassTreeMask.cc
===================================================================
--- code/branches/cpp11_v3/src/libraries/core/ClassTreeMask.cc	(revision 11053)
+++ code/branches/cpp11_v3/src/libraries/core/ClassTreeMask.cc	(revision 11054)
@@ -207,5 +207,5 @@
             return ((*this->nodes_.top().first) == compare);
         else
-            return (compare == 0);
+            return (compare == nullptr);
     }
 
@@ -218,5 +218,5 @@
             return ((*this->nodes_.top().first) != compare);
         else
-            return (compare != 0);
+            return (compare != nullptr);
     }
 
@@ -293,8 +293,8 @@
         {
             // No it's not: Search for classes inheriting from the given class and add the rules for them
-            for (std::set<const Identifier*>::const_iterator it = subclass->getDirectChildren().begin(); it != subclass->getDirectChildren().end(); ++it)
-                if ((*it)->isA(this->root_->getClass()))
-                    if (overwrite || (!this->nodeExists(*it))) // If we don't want to overwrite, only add nodes that don't already exist
-                        this->add(this->root_, *it, bInclude, overwrite);
+            for (const Identifier* directChild : subclass->getDirectChildren())
+                if (directChild->isA(this->root_->getClass()))
+                    if (overwrite || (!this->nodeExists(directChild))) // If we don't want to overwrite, only add nodes that don't already exist
+                        this->add(this->root_, directChild, bInclude, overwrite);
         }
 
@@ -325,10 +325,10 @@
         {
             // Search for an already existing node, containing the subclass we want to add
-            for (std::list<ClassTreeMaskNode*>::iterator it = node->subnodes_.begin(); it != node->subnodes_.end(); ++it)
+            for (ClassTreeMaskNode* subnode : node->subnodes_)
             {
-                if (subclass->isA((*it)->getClass()))
+                if (subclass->isA(subnode->getClass()))
                 {
                     // We've found an existing node -> delegate the work with a recursive function-call and return
-                    this->add(*it, subclass, bInclude, overwrite);
+                    this->add(subnode, subclass, bInclude, overwrite);
                     return;
                 }
@@ -392,6 +392,6 @@
         if (!subclass)
             return;
-        for (std::set<const Identifier*>::const_iterator it = subclass->getDirectChildren().begin(); it != subclass->getDirectChildren().end(); ++it)
-            this->add(*it, this->isIncluded(*it), false, false);
+        for (const Identifier* directChild : subclass->getDirectChildren())
+            this->add(directChild, this->isIncluded(directChild), false, false);
 
         this->add(subclass, bInclude, false, clean);
@@ -435,7 +435,7 @@
 
             // Go through the list of subnodes and look for a node containing the searched subclass and delegate the request by a recursive function-call.
-            for (std::list<ClassTreeMaskNode*>::iterator it = node->subnodes_.begin(); it != node->subnodes_.end(); ++it)
-                if (subclass->isA((*it)->getClass()))
-                    return isIncluded(*it, subclass);
+            for (ClassTreeMaskNode* subnode : node->subnodes_)
+                if (subclass->isA(subnode->getClass()))
+                    return isIncluded(subnode, subclass);
 
             // There is no subnode containing our class -> the rule of the current node takes in effect
@@ -851,5 +851,5 @@
             this->objectIterator_ = Context::getRootContext()->getObjectList(this->subclassIterator_->first)->begin();
         else
-            this->objectIterator_ = ObjectList<BaseObject>::end();
+            this->objectIterator_ = ObjectList<BaseObject>().end();
 
         // Check if the iterator points on a valid object. If not, go to the next object by calling ++
@@ -915,8 +915,8 @@
 
             // Iterate through all subnodes
-            for (std::list<ClassTreeMaskNode*>::iterator it1 = node->subnodes_.begin(); it1 != node->subnodes_.end(); ++it1)
+            for (ClassTreeMaskNode* subnode : node->subnodes_)
             {
                 // Recursive call to this function with the subnode
-                this->create(*it1);
+                this->create(subnode);
 
                 // Only execute the following code if the current node is included, meaning some of the subnodes might be included too
@@ -926,22 +926,22 @@
 
                     // Iterate through all direct children
-                    for (std::set<const Identifier*>::iterator it2 = directChildren.begin(); it2 != directChildren.end(); ++it2)
+                    for (std::set<const Identifier*>::iterator it = directChildren.begin(); it != directChildren.end(); ++it)
                     {
                         // Check if the subnode (it1) is a child of the directChild (it2)
-                        if ((*it1)->getClass()->isA(*it2))
+                        if (subnode->getClass()->isA(*it))
                         {
                             // Yes it is - remove the directChild (it2) from the list, because it will already be handled by a recursive call to the create() function
-                            directChildren.erase(it2);
+                            directChildren.erase(it);
 
                             // Check if the removed directChild was exactly the subnode
-                            if (!(*it1)->getClass()->isExactlyA(*it2))
+                            if (!subnode->getClass()->isExactlyA(*it))
                             {
                                 // No, it wasn't exactly the subnode - therefore there are some classes between
 
                                 // Add the previously removed directChild (it2) to the subclass-list
-                                this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>(*it2, true));
+                                this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>(*it, true));
 
                                 // Insert all directChildren of the directChild
-                                directChildren.insert((*it2)->getDirectChildren().begin(), (*it2)->getDirectChildren().end());
+                                directChildren.insert((*it)->getDirectChildren().begin(), (*it)->getDirectChildren().end());
 
                                 // Restart the scan with the expanded set of directChildren
@@ -957,6 +957,6 @@
             // The bool is "false", meaning they have no subnodes and therefore need no further checks
             if (node->isIncluded())
-                for (std::set<const Identifier*>::iterator it = directChildren.begin(); it != directChildren.end(); ++it)
-                    this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>(*it, false));
+                for (const Identifier* directChild : directChildren)
+                    this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>(directChild, false));
         }
     }
