[Orxonox-commit 6262] r10919 - in code/branches/cpp11_v2: src/libraries/core src/libraries/core/class src/libraries/core/command src/libraries/core/commandline src/libraries/core/config src/libraries/core/input src/libraries/core/module src/libraries/network src/libraries/network/packet src/libraries/network/synchronisable src/libraries/tools/interfaces src/libraries/util src/modules/docking src/modules/dodgerace src/modules/gametypes src/modules/invader src/modules/jump src/modules/objects src/modules/objects/controllers src/modules/objects/eventsystem src/modules/objects/triggers src/modules/overlays/hud src/modules/pickup src/modules/tetris src/modules/towerdefense src/modules/weapons/projectiles src/orxonox src/orxonox/chat src/orxonox/collisionshapes src/orxonox/controllers src/orxonox/gamestates src/orxonox/gametypes src/orxonox/infos src/orxonox/interfaces src/orxonox/items src/orxonox/overlays src/orxonox/sound src/orxonox/weaponsystem src/orxonox/worldentities src/orxonox/worldentities/pawns test/util

landauf at orxonox.net landauf at orxonox.net
Sat Dec 5 22:47:51 CET 2015


Author: landauf
Date: 2015-12-05 22:47:51 +0100 (Sat, 05 Dec 2015)
New Revision: 10919

Modified:
   code/branches/cpp11_v2/src/libraries/core/BaseObject.cc
   code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.cc
   code/branches/cpp11_v2/src/libraries/core/Core.cc
   code/branches/cpp11_v2/src/libraries/core/CoreConfig.cc
   code/branches/cpp11_v2/src/libraries/core/CoreStaticInitializationHandler.cc
   code/branches/cpp11_v2/src/libraries/core/Game.cc
   code/branches/cpp11_v2/src/libraries/core/GraphicsManager.cc
   code/branches/cpp11_v2/src/libraries/core/NamespaceNode.cc
   code/branches/cpp11_v2/src/libraries/core/ThreadPool.cc
   code/branches/cpp11_v2/src/libraries/core/WindowEventListener.cc
   code/branches/cpp11_v2/src/libraries/core/class/Identifier.cc
   code/branches/cpp11_v2/src/libraries/core/class/Identifier.h
   code/branches/cpp11_v2/src/libraries/core/class/Super.h
   code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc
   code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc
   code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc
   code/branches/cpp11_v2/src/libraries/core/commandline/CommandLineParser.cc
   code/branches/cpp11_v2/src/libraries/core/config/SettingsConfigFile.cc
   code/branches/cpp11_v2/src/libraries/core/input/InputBuffer.cc
   code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc
   code/branches/cpp11_v2/src/libraries/core/input/JoyStickQuantityListener.cc
   code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc
   code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.cc
   code/branches/cpp11_v2/src/libraries/core/input/KeyDetector.cc
   code/branches/cpp11_v2/src/libraries/core/module/ModuleInstance.cc
   code/branches/cpp11_v2/src/libraries/network/Client.cc
   code/branches/cpp11_v2/src/libraries/network/ClientConnectionListener.cc
   code/branches/cpp11_v2/src/libraries/network/Connection.cc
   code/branches/cpp11_v2/src/libraries/network/FunctionCallManager.cc
   code/branches/cpp11_v2/src/libraries/network/GamestateManager.cc
   code/branches/cpp11_v2/src/libraries/network/Host.cc
   code/branches/cpp11_v2/src/libraries/network/MasterServer.cc
   code/branches/cpp11_v2/src/libraries/network/PeerList.cc
   code/branches/cpp11_v2/src/libraries/network/Server.cc
   code/branches/cpp11_v2/src/libraries/network/packet/ClassID.cc
   code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.cc
   code/branches/cpp11_v2/src/libraries/network/packet/ServerInformation.h
   code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc
   code/branches/cpp11_v2/src/libraries/tools/interfaces/ToolsInterfaceCompilation.cc
   code/branches/cpp11_v2/src/libraries/util/Serialise.h
   code/branches/cpp11_v2/src/modules/docking/Dock.cc
   code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc
   code/branches/cpp11_v2/src/modules/dodgerace/DodgeRace.cc
   code/branches/cpp11_v2/src/modules/dodgerace/DodgeRaceShip.cc
   code/branches/cpp11_v2/src/modules/gametypes/SpaceRace.cc
   code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc
   code/branches/cpp11_v2/src/modules/invader/Invader.cc
   code/branches/cpp11_v2/src/modules/invader/InvaderEnemy.cc
   code/branches/cpp11_v2/src/modules/invader/InvaderShip.cc
   code/branches/cpp11_v2/src/modules/jump/JumpProjectile.cc
   code/branches/cpp11_v2/src/modules/objects/Attacher.cc
   code/branches/cpp11_v2/src/modules/objects/ForceField.cc
   code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc
   code/branches/cpp11_v2/src/modules/objects/controllers/TurretController.cc
   code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc
   code/branches/cpp11_v2/src/modules/objects/eventsystem/EventListener.cc
   code/branches/cpp11_v2/src/modules/objects/eventsystem/EventTarget.cc
   code/branches/cpp11_v2/src/modules/objects/triggers/Trigger.cc
   code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc
   code/branches/cpp11_v2/src/modules/pickup/PickupSpawner.cc
   code/branches/cpp11_v2/src/modules/tetris/Tetris.cc
   code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseEnemy.cc
   code/branches/cpp11_v2/src/modules/weapons/projectiles/GravityBombField.cc
   code/branches/cpp11_v2/src/orxonox/LevelManager.cc
   code/branches/cpp11_v2/src/orxonox/MoodManager.cc
   code/branches/cpp11_v2/src/orxonox/PlayerManager.cc
   code/branches/cpp11_v2/src/orxonox/Radar.cc
   code/branches/cpp11_v2/src/orxonox/Scene.cc
   code/branches/cpp11_v2/src/orxonox/chat/ChatHistory.cc
   code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc
   code/branches/cpp11_v2/src/orxonox/controllers/FormationController.cc
   code/branches/cpp11_v2/src/orxonox/controllers/ScriptController.cc
   code/branches/cpp11_v2/src/orxonox/controllers/WaypointPatrolController.cc
   code/branches/cpp11_v2/src/orxonox/gamestates/GSLevel.cc
   code/branches/cpp11_v2/src/orxonox/gamestates/GSRoot.cc
   code/branches/cpp11_v2/src/orxonox/gametypes/Gametype.cc
   code/branches/cpp11_v2/src/orxonox/gametypes/Mission.cc
   code/branches/cpp11_v2/src/orxonox/infos/GametypeInfo.cc
   code/branches/cpp11_v2/src/orxonox/interfaces/NotificationListener.cc
   code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.cc
   code/branches/cpp11_v2/src/orxonox/interfaces/PickupListener.cc
   code/branches/cpp11_v2/src/orxonox/items/MultiStateEngine.cc
   code/branches/cpp11_v2/src/orxonox/overlays/OverlayGroup.cc
   code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc
   code/branches/cpp11_v2/src/orxonox/sound/WorldAmbientSound.cc
   code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponPack.cc
   code/branches/cpp11_v2/src/orxonox/worldentities/ControllableEntity.cc
   code/branches/cpp11_v2/src/orxonox/worldentities/EffectContainer.cc
   code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
   code/branches/cpp11_v2/src/orxonox/worldentities/pawns/Pawn.cc
   code/branches/cpp11_v2/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc
   code/branches/cpp11_v2/test/util/MathTest.cc
Log:
use range-based for-loop where it makes sense (e.g. ObjectList)

Modified: code/branches/cpp11_v2/src/libraries/core/BaseObject.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/BaseObject.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/BaseObject.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -162,8 +162,8 @@
     {
         this->setName(name);
 
-        for (ObjectList<XMLNameListener>::iterator it = ObjectList<XMLNameListener>::begin(); it != ObjectList<XMLNameListener>::end(); ++it)
-            it->loadedNewXMLName(this);
+        for (XMLNameListener* listener : ObjectList<XMLNameListener>())
+            listener->loadedNewXMLName(this);
     }
 
     /**

Modified: code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -914,10 +914,10 @@
             std::set<const Identifier*> directChildren = node->getClass()->getDirectChildren();
 
             // 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
                 if (node->isIncluded())
@@ -925,24 +925,24 @@
                     scanChildren: // This is a label for goto
 
                     // 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
                                 goto scanChildren;

Modified: code/branches/cpp11_v2/src/libraries/core/Core.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/Core.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/Core.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -459,8 +459,8 @@
     void Core::preUpdate(const Clock& time)
     {
         // Update UpdateListeners before general ticking
-        for (ObjectList<UpdateListener>::iterator it = ObjectList<UpdateListener>::begin(); it != ObjectList<UpdateListener>::end(); ++it)
-            it->preUpdate(time);
+        for (UpdateListener* listener : ObjectList<UpdateListener>())
+            listener->preUpdate(time);
         if (this->bGraphicsLoaded_)
         {
             // Process input events
@@ -478,8 +478,8 @@
     void Core::postUpdate(const Clock& time)
     {
         // Update UpdateListeners just before rendering
-        for (ObjectList<UpdateListener>::iterator it = ObjectList<UpdateListener>::begin(); it != ObjectList<UpdateListener>::end(); ++it)
-            it->postUpdate(time);
+        for (UpdateListener* listener : ObjectList<UpdateListener>())
+            listener->postUpdate(time);
         if (this->bGraphicsLoaded_)
         {
             // Render (doesn't throw)

Modified: code/branches/cpp11_v2/src/libraries/core/CoreConfig.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/CoreConfig.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/CoreConfig.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -107,9 +107,8 @@
     void CoreConfig::devModeChanged()
     {
         // Inform listeners
-        ObjectList<DevModeListener>::iterator it = ObjectList<DevModeListener>::begin();
-        for (; it != ObjectList<DevModeListener>::end(); ++it)
-            it->devModeChanged(bDevMode_);
+        for (DevModeListener* listener : ObjectList<DevModeListener>())
+            listener->devModeChanged(bDevMode_);
     }
 
     //! Callback function if the language has changed.

Modified: code/branches/cpp11_v2/src/libraries/core/CoreStaticInitializationHandler.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/CoreStaticInitializationHandler.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/CoreStaticInitializationHandler.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -128,8 +128,8 @@
             if (!identifier->isExactlyA(Class(Context)))
             {
                 // iterate over all contexts
-                for (ObjectList<Context>::iterator it_context = ObjectList<Context>::begin(); it_context != ObjectList<Context>::end(); ++it_context)
-                    it_context->destroyObjectList(identifier);
+                for (Context* context : ObjectList<Context>())
+                    context->destroyObjectList(identifier);
             }
         }
     }

Modified: code/branches/cpp11_v2/src/libraries/core/Game.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/Game.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/Game.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -114,11 +114,10 @@
         this->config_ = new GameConfig();
 
         // After the core has been created, we can safely instantiate the GameStates that don't require graphics
-        for (std::map<std::string, GameStateInfo>::const_iterator it = gameStateDeclarations_s.begin();
-            it != gameStateDeclarations_s.end(); ++it)
+        for (const auto& mapEntry : gameStateDeclarations_s)
         {
-            if (!it->second.bGraphicsMode)
-                constructedStates_[it->second.stateName] = GameStateFactory::fabricate(it->second);
+            if (!mapEntry.second.bGraphicsMode)
+                constructedStates_[mapEntry.second.stateName] = GameStateFactory::fabricate(mapEntry.second);
         }
 
         // The empty root state is ALWAYS loaded!
@@ -261,26 +260,25 @@
     void Game::updateGameStates()
     {
         // Note: The first element is the empty root state, which doesn't need ticking
-        for (GameStateVector::const_iterator it = this->loadedStates_.begin() + 1;
-            it != this->loadedStates_.end(); ++it)
+        for (const std::shared_ptr<GameState>& state : this->loadedStates_)
         {
             try
             {
                 // Add tick time for most of the states
                 uint64_t timeBeforeTick = 0;
-                if ((*it)->getInfo().bIgnoreTickTime)
+                if (state->getInfo().bIgnoreTickTime)
                     timeBeforeTick = this->gameClock_->getRealMicroseconds();
-                (*it)->update(*this->gameClock_);
-                if ((*it)->getInfo().bIgnoreTickTime)
+                state->update(*this->gameClock_);
+                if (state->getInfo().bIgnoreTickTime)
                     this->subtractTickTime(static_cast<int32_t>(this->gameClock_->getRealMicroseconds() - timeBeforeTick));
             }
             catch (...)
             {
-                orxout(user_error) << "An exception occurred while updating '" << (*it)->getName() << "': " << Exception::handleMessage() << endl;
+                orxout(user_error) << "An exception occurred while updating '" << state->getName() << "': " << Exception::handleMessage() << endl;
                 orxout(user_error) << "This should really never happen!" << endl;
                 orxout(user_error) << "Unloading all GameStates depending on the one that crashed." << endl;
                 std::shared_ptr<GameStateTreeNode> current = this->loadedTopStateNode_;
-                while (current->name_ != (*it)->getName() && current)
+                while (current->name_ != state->getName() && current)
                     current = current->parent_.lock();
                 if (current && current->parent_.lock())
                     this->requestState(current->parent_.lock()->name_);
@@ -519,15 +517,14 @@
             Loki::ScopeGuard graphicsUnloader = Loki::MakeObjGuard(*this, &Game::unloadGraphics, true);
 
             // Construct all the GameStates that require graphics
-            for (std::map<std::string, GameStateInfo>::const_iterator it = gameStateDeclarations_s.begin();
-                it != gameStateDeclarations_s.end(); ++it)
+            for (const auto& mapEntry : gameStateDeclarations_s)
             {
-                if (it->second.bGraphicsMode)
+                if (mapEntry.second.bGraphicsMode)
                 {
                     // Game state loading failure is serious --> don't catch
-                    std::shared_ptr<GameState> gameState = GameStateFactory::fabricate(it->second);
+                    std::shared_ptr<GameState> gameState = GameStateFactory::fabricate(mapEntry.second);
                     if (!constructedStates_.insert(std::make_pair(
-                        it->second.stateName, gameState)).second)
+                        mapEntry.second.stateName, gameState)).second)
                         assert(false); // GameState was already created!
                 }
             }

Modified: code/branches/cpp11_v2/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/GraphicsManager.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/GraphicsManager.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -388,8 +388,8 @@
         this->viewport_->setCamera(camera);
         GUIManager::getInstance().setCamera(camera);
 
-        for (ObjectList<ViewportEventListener>::iterator it = ObjectList<ViewportEventListener>::begin(); it != ObjectList<ViewportEventListener>::end(); ++it)
-            it->cameraChanged(this->viewport_, oldCamera);
+        for (ViewportEventListener* listener : ObjectList<ViewportEventListener>())
+            listener->cameraChanged(this->viewport_, oldCamera);
     }
 
     /**

Modified: code/branches/cpp11_v2/src/libraries/core/NamespaceNode.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/NamespaceNode.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/NamespaceNode.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -148,12 +148,13 @@
             output += " (";
 
             int i = 0;
-            for (std::map<std::string, NamespaceNode*>::const_iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); i++, ++it)
+            for (const auto& mapEntry : this->subnodes_)
             {
                 if (i > 0)
                     output += ", ";
 
-                output += it->second->toString();
+                output += mapEntry.second->toString();
+                i++;
             }
 
             output += ')';

Modified: code/branches/cpp11_v2/src/libraries/core/ThreadPool.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/ThreadPool.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/ThreadPool.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -82,13 +82,12 @@
 
     bool ThreadPool::passFunction( const ExecutorPtr& executor, bool addThread )
     {
-        std::vector<Thread*>::iterator it;
-        for ( it=this->threadPool_.begin(); it!=this->threadPool_.end(); ++it )
+        for ( Thread* thread : threadPool_ )
         {
-            if ( ! (*it)->isWorking() )
+            if ( ! thread->isWorking() )
             {
                 // If that fails, then there is some code error
-                OrxVerify( (*it)->evaluateExecutor( executor ), "ERROR: could not evaluate Executor" );
+                OrxVerify( thread->evaluateExecutor( executor ), "ERROR: could not evaluate Executor" );
                 return true;
             }
         }
@@ -104,10 +103,9 @@
 
     void ThreadPool::synchronise()
     {
-        std::vector<Thread*>::iterator it;
-        for ( it=this->threadPool_.begin(); it!=this->threadPool_.end(); ++it )
+        for ( Thread* thread : this->threadPool_ )
         {
-            (*it)->waitUntilFinished();
+            thread->waitUntilFinished();
         }
     }
 

Modified: code/branches/cpp11_v2/src/libraries/core/WindowEventListener.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/WindowEventListener.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/WindowEventListener.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -44,8 +44,8 @@
     //! Calls all registered objects
     /*static*/ void WindowEventListener::moveWindow()
     {
-        for (ObjectList<WindowEventListener>::iterator it = ObjectList<WindowEventListener>::begin(); it; ++it)
-            it->windowMoved();
+        for (WindowEventListener* listener : ObjectList<WindowEventListener>())
+            listener->windowMoved();
     }
 
     //! Calls all registered objects and sets the static variables
@@ -53,14 +53,14 @@
     {
         windowWidth_s = newWidth;
         windowHeight_s = newHeight;
-        for (ObjectList<WindowEventListener>::iterator it = ObjectList<WindowEventListener>::begin(); it; ++it)
-            it->windowResized(newWidth, newHeight);
+        for (WindowEventListener* listener : ObjectList<WindowEventListener>())
+            listener->windowResized(newWidth, newHeight);
     }
 
     //! Calls all registered objects
     /*static*/ void WindowEventListener::changeWindowFocus(bool bFocus)
     {
-        for (ObjectList<WindowEventListener>::iterator it = ObjectList<WindowEventListener>::begin(); it; ++it)
-            it->windowFocusChanged(bFocus);
+        for (WindowEventListener* listener : ObjectList<WindowEventListener>())
+            listener->windowFocusChanged(bFocus);
     }
 }

Modified: code/branches/cpp11_v2/src/libraries/core/class/Identifier.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/class/Identifier.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/class/Identifier.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -78,14 +78,14 @@
         if (this->factory_)
             delete this->factory_;
 
-        for (std::list<const InheritsFrom*>::const_iterator it = this->manualDirectParents_.begin(); it != this->manualDirectParents_.end(); ++it)
-            delete (*it);
+        for (const InheritsFrom* manualDirectParent : this->manualDirectParents_)
+            delete manualDirectParent;
 
         // erase this Identifier from all related identifiers
-        for (std::list<const Identifier*>::const_iterator it = this->parents_.begin(); it != this->parents_.end(); ++it)
-            const_cast<Identifier*>(*it)->children_.erase(this);
-        for (std::list<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
-            const_cast<Identifier*>(*it)->directChildren_.erase(this);
+        for (const Identifier* parent : this->parents_)
+            const_cast<Identifier*>(parent)->children_.erase(this);
+        for (const Identifier* directParent : this->directParents_)
+            const_cast<Identifier*>(directParent)->directChildren_.erase(this);
         for (const Identifier* child : this->children_)
             const_cast<Identifier*>(child)->parents_.remove(this);
         for (const Identifier* directChild : this->directChildren_)
@@ -183,14 +183,14 @@
             // parents defined -> this class was initialized by creating a sample instance and recording the trace of identifiers
 
             // initialize all parents
-            for (std::list<const Identifier*>::const_iterator it = this->parents_.begin(); it != this->parents_.end(); ++it)
-                const_cast<Identifier*>(*it)->finishInitialization(); // initialize parent
+            for (const Identifier* parent : this->parents_)
+                const_cast<Identifier*>(parent)->finishInitialization(); // initialize parent
 
             // parents of parents are no direct parents of this identifier
             this->directParents_ = this->parents_;
-            for (std::list<const Identifier*>::const_iterator it_parent = this->parents_.begin(); it_parent != this->parents_.end(); ++it_parent)
-                for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(*it_parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(*it_parent)->parents_.end(); ++it_parent_parent)
-                    this->directParents_.remove(*it_parent_parent);
+            for (const Identifier* parent : this->parents_)
+                for (const Identifier* parent_parent : const_cast<Identifier*>(parent)->parents_)
+                    this->directParents_.remove(parent_parent);
 
             this->verifyIdentifierTrace();
         }
@@ -199,19 +199,19 @@
             // no parents defined -> this class was manually initialized by calling inheritsFrom<Class>()
 
             // initialize all direct parents
-            for (std::list<const InheritsFrom*>::const_iterator it = this->manualDirectParents_.begin(); it != this->manualDirectParents_.end(); ++it)
+            for (const InheritsFrom* manualDirectParent : this->manualDirectParents_)
             {
-                Identifier* directParent = (*it)->getParent();
+                Identifier* directParent = manualDirectParent->getParent();
                 this->directParents_.push_back(directParent);
                 directParent->finishInitialization(); // initialize parent
             }
 
             // direct parents and their parents are also parents of this identifier (but only add them once)
-            for (std::list<const Identifier*>::const_iterator it_parent = this->directParents_.begin(); it_parent != this->directParents_.end(); ++it_parent)
+            for (const Identifier* parent : this->directParents_)
             {
-                for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(*it_parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(*it_parent)->parents_.end(); ++it_parent_parent)
-                    this->addIfNotExists(this->parents_, *it_parent_parent);
-                this->addIfNotExists(this->parents_, *it_parent);
+                for (const Identifier* parent_parent : const_cast<Identifier*>(parent)->parents_)
+                    this->addIfNotExists(this->parents_, parent_parent);
+                this->addIfNotExists(this->parents_, parent);
             }
         }
         else if (!this->isExactlyA(Class(Identifiable)))
@@ -223,16 +223,16 @@
         }
 
         // tell all parents that this identifier is a child
-        for (std::list<const Identifier*>::const_iterator it = this->parents_.begin(); it != this->parents_.end(); ++it)
-            const_cast<Identifier*>(*it)->children_.insert(this);
+        for (const Identifier* parent : this->parents_)
+            const_cast<Identifier*>(parent)->children_.insert(this);
 
         // tell all direct parents that this identifier is a direct child
-        for (std::list<const Identifier*>::const_iterator it = this->directParents_.begin(); it != this->directParents_.end(); ++it)
+        for (const Identifier* directChild : this->directParents_)
         {
-            const_cast<Identifier*>(*it)->directChildren_.insert(this);
+            const_cast<Identifier*>(directChild)->directChildren_.insert(this);
 
             // Create the super-function dependencies
-            (*it)->createSuperFunctionCaller();
+            directChild->createSuperFunctionCaller();
         }
 
         this->bInitialized_ = true;
@@ -264,8 +264,8 @@
         {
             if (parent->isVirtualBase())
             {
-                for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(parent)->parents_.end(); ++it_parent_parent)
-                    this->addIfNotExists(expectedIdentifierTrace, *it_parent_parent);
+                for (const Identifier* parent_parent : const_cast<Identifier*>(parent)->parents_)
+                    this->addIfNotExists(expectedIdentifierTrace, parent_parent);
                 this->addIfNotExists(expectedIdentifierTrace, parent);
             }
         }
@@ -273,8 +273,8 @@
         // now all direct parents get created recursively. already added identifiers (e.g. virtual base classes) are not added again.
         for (const Identifier* directParent : this->directParents_)
         {
-            for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(directParent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(directParent)->parents_.end(); ++it_parent_parent)
-                this->addIfNotExists(expectedIdentifierTrace, *it_parent_parent);
+            for (const Identifier* parent_parent : const_cast<Identifier*>(directParent)->parents_)
+                this->addIfNotExists(expectedIdentifierTrace, parent_parent);
             this->addIfNotExists(expectedIdentifierTrace, directParent);
         }
 
@@ -289,8 +289,8 @@
             orxout(internal_warning) << endl;
 
             orxout(internal_warning) << "  Expected trace (according to class hierarchy definitions):" << endl << "    ";
-            for (std::list<const Identifier*>::const_iterator it_parent = expectedIdentifierTrace.begin(); it_parent != expectedIdentifierTrace.end(); ++it_parent)
-                orxout(internal_warning) << " " << (*it_parent)->getName();
+            for (const Identifier* parent : expectedIdentifierTrace)
+                orxout(internal_warning) << " " << parent->getName();
             orxout(internal_warning) << endl;
 
             orxout(internal_warning) << "  Direct parents (according to class hierarchy definitions):" << endl << "    ";

Modified: code/branches/cpp11_v2/src/libraries/core/class/Identifier.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/class/Identifier.h	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/class/Identifier.h	2015-12-05 21:47:51 UTC (rev 10919)
@@ -457,8 +457,8 @@
         if (!this->hasConfigValues())
             return;
 
-        for (ObjectListIterator<T> it = ObjectList<T>::begin(); it; ++it)
-            this->setConfigValues(*it, *it);
+        for (T* object : ObjectList<T>())
+            this->setConfigValues(object, object);
 
         if (updateChildren)
             for (const Identifier* child : this->getChildren())

Modified: code/branches/cpp11_v2/src/libraries/core/class/Super.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/class/Super.h	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/class/Super.h	2015-12-05 21:47:51 UTC (rev 10919)
@@ -102,22 +102,22 @@
             static void apply(baseclass*) \
             { \
                 ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier(); \
-                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren().begin(); it != identifier->getDirectChildren().end(); ++it) \
+                for (const Identifier* child : identifier->getDirectChildren()) \
                 { \
-                    if (((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
+                    if (((ClassIdentifier<T>*)child)->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_) \
                     { \
-                        delete ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_; \
-                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = nullptr; \
-                        ((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ = false; \
+                        delete ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_; \
+                        ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_ = nullptr; \
+                        ((ClassIdentifier<T>*)child)->bSuperFunctionCaller_##functionname##_isFallback_ = false; \
                     } \
                     \
-                    if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_) \
+                    if (!((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_) \
                     { \
-                        orxout(verbose, context::super) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)(*it))->getName() << endl; \
-                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>; \
+                        orxout(verbose, context::super) << "Added SuperFunctionCaller for " << #functionname << ": " << ClassIdentifier<T>::getIdentifier()->getName() << " <- " << ((ClassIdentifier<T>*)child)->getName() << endl; \
+                        ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>; \
                     } \
-                    else if (((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier() != ClassIdentifier<T>::getIdentifier()) \
-                        orxout(internal_warning, context::super) << "SuperFunctionCaller for " << #functionname << " in " << ((ClassIdentifier<T>*)(*it))->getName() << " calls function of " << ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier()->getName() << " but " << ClassIdentifier<T>::getIdentifier()->getName() << " is also possible (do you use multiple inheritance?)" << endl; \
+                    else if (((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_->getParentIdentifier() != ClassIdentifier<T>::getIdentifier()) \
+                        orxout(internal_warning, context::super) << "SuperFunctionCaller for " << #functionname << " in " << ((ClassIdentifier<T>*)child)->getName() << " calls function of " << ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_->getParentIdentifier()->getName() << " but " << ClassIdentifier<T>::getIdentifier()->getName() << " is also possible (do you use multiple inheritance?)" << endl; \
                 } \
             } \
         }; \
@@ -170,28 +170,28 @@
                 ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier();
 
                 // Iterate through all children
-                for (std::set<const Identifier*>::iterator it = identifier->getDirectChildren().begin(); it != identifier->getDirectChildren().end(); ++it)
+                for (const Identifier* child : identifier->getDirectChildren())
                 {
                     // Check if the caller is a fallback-caller
-                    if (((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_)
+                    if (((ClassIdentifier<T>*)child)->bSuperFunctionCaller_##functionname##_isFallback_ && ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_)
                     {
                         // Delete the fallback caller an prepare to get a real caller
-                        delete ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_;
-                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = nullptr;
-                        ((ClassIdentifier<T>*)(*it))->bSuperFunctionCaller_##functionname##_isFallback_ = false;
+                        delete ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_;
+                        ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_ = nullptr;
+                        ((ClassIdentifier<T>*)child)->bSuperFunctionCaller_##functionname##_isFallback_ = false;
                     }
 
                     // Check if there's not already a caller
-                    if (!((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_)
+                    if (!((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_)
                     {
                         // Add the SuperFunctionCaller
-                        orxout(verbose, context::super) << "adding functionpointer to " << ((ClassIdentifier<T>*)(*it))->getName() << endl;
-                        ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>;
+                        orxout(verbose, context::super) << "adding functionpointer to " << ((ClassIdentifier<T>*)child)->getName() << endl;
+                        ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_ = new SuperFunctionClassCaller_##functionname <T>;
                     }
 
                     // If there is already a caller, but for another parent, print a warning
-                    else if (((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier() != ClassIdentifier<T>::getIdentifier())
-                        orxout(internal_warning, context::super) << "SuperFunctionCaller for " << #functionname << " in " << ((ClassIdentifier<T>*)(*it))->getName() << " calls function of " << ((ClassIdentifier<T>*)(*it))->superFunctionCaller_##functionname##_->getParentIdentifier()->getName() << " but " << ClassIdentifier<T>::getIdentifier()->getName() << " is also possible (do you use multiple inheritance?)" << endl;
+                    else if (((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_->getParentIdentifier() != ClassIdentifier<T>::getIdentifier())
+                        orxout(internal_warning, context::super) << "SuperFunctionCaller for " << #functionname << " in " << ((ClassIdentifier<T>*)child)->getName() << " calls function of " << ((ClassIdentifier<T>*)child)->superFunctionCaller_##functionname##_->getParentIdentifier()->getName() << " but " << ClassIdentifier<T>::getIdentifier()->getName() << " is also possible (do you use multiple inheritance?)" << endl;
                 }
             }
         };

Modified: code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/command/ArgumentCompletionFunctions.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -333,8 +333,8 @@
             std::list<unsigned int> threadnumbers = TclThreadManager::getInstance().getThreadList();
             ArgumentCompletionList threads;
 
-            for (std::list<unsigned int>::const_iterator it = threadnumbers.begin(); it != threadnumbers.end(); ++it)
-                threads.emplace_back(multi_cast<std::string>(*it));
+            for (unsigned int threadnumber : threadnumbers)
+                threads.emplace_back(multi_cast<std::string>(threadnumber));
 
             return threads;
         }

Modified: code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/command/CommandEvaluation.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -327,13 +327,13 @@
         unsigned int nearestDistance = (unsigned int)-1;
 
         // iterate through all groups and their commands and calculate the distance to the current command. keep the best.
-        for (const auto& mapEntry : ConsoleCommandManager::getInstance().getCommandsLC())
+        for (const auto& mapEntryGroup : ConsoleCommandManager::getInstance().getCommandsLC())
         {
-            if (mapEntry.first != "")
+            if (mapEntryGroup.first != "")
             {
-                for (std::map<std::string, ConsoleCommand*>::const_iterator it_name = mapEntry.second.begin(); it_name != mapEntry.second.end(); ++it_name)
+                for (const auto& mapEntryName : mapEntryGroup.second)
                 {
-                    std::string command = mapEntry.first + " " + it_name->first;
+                    std::string command = mapEntryGroup.first + " " + mapEntryName.first;
                     unsigned int distance = getLevenshteinDistance(command, token0_LC + " " + token1_LC);
                     if (distance < nearestDistance)
                     {

Modified: code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/command/TclThreadManager.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -144,12 +144,12 @@
             // Execute commands in the queues of the threaded interpreters
             {
                 boost::shared_lock<boost::shared_mutex> lock(*this->interpreterBundlesMutex_);
-                for (std::map<unsigned int, TclInterpreterBundle*>::const_iterator it = this->interpreterBundles_.begin(); it != this->interpreterBundles_.end(); ++it)
+                for (const auto& mapEntry : this->interpreterBundles_)
                 {
-                    if (it->first == 0)
+                    if (mapEntry.first == 0)
                         continue; // We'll handle the default interpreter later (and without threads of course)
 
-                    TclInterpreterBundle* bundle = it->second;
+                    TclInterpreterBundle* bundle = mapEntry.second;
                     if (!bundle->queue_.empty())
                     {
                         // There are commands in the queue

Modified: code/branches/cpp11_v2/src/libraries/core/commandline/CommandLineParser.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/commandline/CommandLineParser.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/commandline/CommandLineParser.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -109,13 +109,12 @@
             if (bFirstTimeParse_)
             {
                 // first shove all the shortcuts in a map
-                for (std::map<std::string, CommandLineArgument*>::const_iterator it = cmdLineArgs_.begin();
-                    it != cmdLineArgs_.end(); ++it)
+                for (const auto& mapEntry : cmdLineArgs_)
                 {
-                    OrxAssert(cmdLineArgsShortcut_.find(it->second->getShortcut()) == cmdLineArgsShortcut_.end(),
+                    OrxAssert(cmdLineArgsShortcut_.find(mapEntry.second->getShortcut()) == cmdLineArgsShortcut_.end(),
                         "Cannot have two command line shortcut with the same name.");
-                    if (!it->second->getShortcut().empty())
-                        cmdLineArgsShortcut_[it->second->getShortcut()] = it->second;
+                    if (!mapEntry.second->getShortcut().empty())
+                        cmdLineArgsShortcut_[mapEntry.second->getShortcut()] = mapEntry.second;
                 }
                 bFirstTimeParse_ = false;
             }
@@ -256,31 +255,29 @@
 
         // determine maximum name size
         size_t maxNameSize = 0;
-        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
-            it != inst.cmdLineArgs_.end(); ++it)
+        for (const auto& mapEntry : inst.cmdLineArgs_)
         {
-            maxNameSize = std::max(it->second->getName().size(), maxNameSize);
+            maxNameSize = std::max(mapEntry.second->getName().size(), maxNameSize);
         }
 
         infoStr << endl;
         infoStr << "Usage: orxonox [options]" << endl;
         infoStr << "Available options:" << endl;
 
-        for (std::map<std::string, CommandLineArgument*>::const_iterator it = inst.cmdLineArgs_.begin();
-            it != inst.cmdLineArgs_.end(); ++it)
+        for (const auto& mapEntry : inst.cmdLineArgs_)
         {
-            if (!it->second->getShortcut().empty())
-                infoStr << " [-" << it->second->getShortcut() << "] ";
+            if (!mapEntry.second->getShortcut().empty())
+                infoStr << " [-" << mapEntry.second->getShortcut() << "] ";
             else
                 infoStr << "      ";
-            infoStr << "--" << it->second->getName() << ' ';
-            if (it->second->getValue().isType<bool>())
+            infoStr << "--" << mapEntry.second->getName() << ' ';
+            if (mapEntry.second->getValue().isType<bool>())
                 infoStr << "    ";
             else
                 infoStr << "ARG ";
             // fill with the necessary amount of blanks
-            infoStr << std::string(maxNameSize - it->second->getName().size(), ' ');
-            infoStr << ": " << it->second->getInformation();
+            infoStr << std::string(maxNameSize - mapEntry.second->getName().size(), ' ');
+            infoStr << ": " << mapEntry.second->getInformation();
             infoStr << endl;
         }
         return infoStr.str();

Modified: code/branches/cpp11_v2/src/libraries/core/config/SettingsConfigFile.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/config/SettingsConfigFile.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/config/SettingsConfigFile.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -141,10 +141,10 @@
     {
         // todo: can this be done more efficiently? looks like some identifiers will be updated multiple times.
 
-        for (ContainerMap::const_iterator it = this->containers_.begin(); it != this->containers_.end(); ++it)
+        for (const auto& mapEntry : this->containers_)
         {
-            it->second.second->update();
-            it->second.second->getIdentifier()->updateConfigValues();
+            mapEntry.second.second->update();
+            mapEntry.second.second->getIdentifier()->updateConfigValues();
         }
     }
 

Modified: code/branches/cpp11_v2/src/libraries/core/input/InputBuffer.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/InputBuffer.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/input/InputBuffer.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -74,9 +74,8 @@
 
     InputBuffer::~InputBuffer()
     {
-        for (std::list<BaseInputBufferListenerTuple*>::const_iterator it = this->listeners_.begin();
-            it != this->listeners_.end(); ++it)
-            delete *it;
+        for (BaseInputBufferListenerTuple* listener : this->listeners_)
+            delete listener;
     }
 
     void InputBuffer::setConfigValues()

Modified: code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/input/InputManager.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -530,10 +530,9 @@
             if (priority >= InputStatePriority::HighPriority || priority == InputStatePriority::Empty)
             {
                 // Make sure we don't add two high priority states with the same priority
-                for (std::map<std::string, InputState*>::const_iterator it = this->statesByName_.begin();
-                    it != this->statesByName_.end(); ++it)
+                for (const auto& mapEntry : this->statesByName_)
                 {
-                    if (it->second->getPriority() == priority)
+                    if (mapEntry.second->getPriority() == priority)
                     {
                         orxout(internal_warning, context::input) << "Could not add an InputState with the same priority '"
                             << static_cast<int>(priority) << "' != 0." << endl;

Modified: code/branches/cpp11_v2/src/libraries/core/input/JoyStickQuantityListener.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/JoyStickQuantityListener.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/input/JoyStickQuantityListener.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -46,7 +46,7 @@
     /*static*/ void JoyStickQuantityListener::changeJoyStickQuantity(const std::vector<JoyStick*>& joyStickList)
     {
         joyStickList_s = joyStickList;
-        for (ObjectList<JoyStickQuantityListener>::iterator it = ObjectList<JoyStickQuantityListener>::begin(); it; ++it)
-            it->JoyStickQuantityChanged(joyStickList);
+        for (JoyStickQuantityListener* listener : ObjectList<JoyStickQuantityListener>())
+            listener->JoyStickQuantityChanged(joyStickList);
     }
 }

Modified: code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/input/KeyBinder.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -273,10 +273,10 @@
         }
 
         // Parse bindings and create the ConfigValueContainers if necessary
-        for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
+        for (const auto& mapEntry : allButtons_)
         {
-            it->second->readBinding(this->configFile_, this->fallbackConfigFile_);
-            addButtonToCommand(it->second->bindingString_, it->second);
+            mapEntry.second->readBinding(this->configFile_, this->fallbackConfigFile_);
+            addButtonToCommand(mapEntry.second->bindingString_, mapEntry.second);
         }
 
         orxout(internal_info, context::input) << "KeyBinder: Loading key bindings done." << endl;
@@ -379,8 +379,8 @@
     */
     void KeyBinder::clearBindings()
     {
-        for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
-            it->second->clear();
+        for (const auto& mapEntry : allButtons_)
+            mapEntry.second->clear();
 
         for (BufferedParamCommand* command : paramCommandBuffer_)
             delete command;

Modified: code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/input/KeyBinderManager.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -75,8 +75,8 @@
     KeyBinderManager::~KeyBinderManager()
     {
         // Delete all remaining KeyBinders
-        for (std::map<std::string, KeyBinder*>::const_iterator it = this->binders_.begin(); it != this->binders_.end(); ++it)
-            delete it->second;
+        for (const auto& mapEntry : this->binders_)
+            delete mapEntry.second;
 
         // Reset console commands
         ModifyConsoleCommand(__CC_keybind_name ).setObject(nullptr);

Modified: code/branches/cpp11_v2/src/libraries/core/input/KeyDetector.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/input/KeyDetector.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/input/KeyDetector.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -69,8 +69,8 @@
     void KeyDetector::assignCommands()
     {
         // Assign every button/axis the same command, but with its name as argument
-        for (std::map<std::string, Button*>::const_iterator it = allButtons_.begin(); it != allButtons_.end(); ++it)
-            it->second->parse(__CC_KeyDetector_callback_name + ' ' + it->second->groupName_ + "." + it->second->name_);
+        for (const auto& mapEntry : allButtons_)
+            mapEntry.second->parse(__CC_KeyDetector_callback_name + ' ' + mapEntry.second->groupName_ + "." + mapEntry.second->name_);
     }
 
     void KeyDetector::callback(const std::string& name)

Modified: code/branches/cpp11_v2/src/libraries/core/module/ModuleInstance.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/core/module/ModuleInstance.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/core/module/ModuleInstance.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -75,8 +75,8 @@
         std::map<StaticInitialization::Type, std::set<StaticallyInitializedInstance*>> copy(this->staticallyInitializedInstancesByType_);
         this->staticallyInitializedInstancesByType_.clear();
         for (const auto& mapEntry : copy)
-            for (std::set<StaticallyInitializedInstance*>::iterator it2 = mapEntry.second.begin(); it2 != mapEntry.second.end(); ++it2)
-                delete (*it2);
+            for (StaticallyInitializedInstance* instance : mapEntry.second)
+                delete instance;
     }
 
 

Modified: code/branches/cpp11_v2/src/libraries/network/Client.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/Client.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/network/Client.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -160,10 +160,9 @@
         if( GamestateManager::update() )
         {
           std::vector<packet::Gamestate*> gamestates = GamestateManager::getGamestates();
-          std::vector<packet::Gamestate*>::iterator it;
-          for( it = gamestates.begin(); it != gamestates.end(); ++it )
+          for( packet::Gamestate* gamestate : gamestates )
           {
-            (*it)->send( static_cast<Host*>(this) );
+            gamestate->send( static_cast<Host*>(this) );
           }
         }
         //assert(gs); <--- there might be the case that no data has to be sent, so its commented out now

Modified: code/branches/cpp11_v2/src/libraries/network/ClientConnectionListener.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/ClientConnectionListener.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/network/ClientConnectionListener.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -43,14 +43,14 @@
 
     void ClientConnectionListener::broadcastClientConnected(unsigned int clientID)
     {
-        for (ObjectList<ClientConnectionListener>::iterator it = ObjectList<ClientConnectionListener>::begin(); it != ObjectList<ClientConnectionListener>::end(); ++it)
-            it->clientConnected(clientID);
+        for (ClientConnectionListener* listener : ObjectList<ClientConnectionListener>())
+            listener->clientConnected(clientID);
     }
 
     void ClientConnectionListener::broadcastClientDisconnected(unsigned int clientID)
     {
-        for (ObjectList<ClientConnectionListener>::iterator it = ObjectList<ClientConnectionListener>::begin(); it != ObjectList<ClientConnectionListener>::end(); ++it)
-            it->clientDisconnected(clientID);
+        for (ClientConnectionListener* listener : ObjectList<ClientConnectionListener>())
+            listener->clientDisconnected(clientID);
     }
 
 //     void ClientConnectionListener::getConnectedClients()

Modified: code/branches/cpp11_v2/src/libraries/network/Connection.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/Connection.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/network/Connection.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -236,10 +236,9 @@
 
   void Connection::disconnectPeersInternal()
   {
-    std::map<uint32_t, ENetPeer*>::iterator it;
-    for( it=this->peerMap_.begin(); it!=this->peerMap_.end(); ++it )
+    for( const auto& mapEntry : this->peerMap_ )
     {
-      enet_peer_disconnect(it->second, 0);
+      enet_peer_disconnect(mapEntry.second, 0);
     }
     uint32_t iterations = NETWORK_DISCONNECT_TIMEOUT/NETWORK_WAIT_TIMEOUT;
     uint32_t i = 0;

Modified: code/branches/cpp11_v2/src/libraries/network/FunctionCallManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/FunctionCallManager.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/network/FunctionCallManager.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -53,11 +53,10 @@
 
 void FunctionCallManager::sendCalls(orxonox::Host* host)
 {
-  std::map<uint32_t, packet::FunctionCalls*>::iterator it;
-  for (it = FunctionCallManager::sPeerMap_.begin(); it != FunctionCallManager::sPeerMap_.end(); ++it )
+  for (const auto& mapEntry : FunctionCallManager::sPeerMap_ )
   {
     assert(!FunctionCallManager::sPeerMap_.empty());
-    it->second->send(host);
+    mapEntry.second->send(host);
   }
   FunctionCallManager::sPeerMap_.clear();
 }

Modified: code/branches/cpp11_v2/src/libraries/network/GamestateManager.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/GamestateManager.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/network/GamestateManager.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -69,15 +69,13 @@
   GamestateManager::~GamestateManager()
   {
     if( this->currentGamestate_ )
-        delete this->currentGamestate_;std::map<unsigned int, packet::Gamestate*>::iterator it;
-    for( it = gamestateQueue.begin(); it != gamestateQueue.end(); ++it )
-      delete it->second;
-    std::map<uint32_t, peerInfo>::iterator peerIt;
-    std::map<uint32_t, packet::Gamestate*>::iterator gamestateIt;
-    for( peerIt = peerMap_.begin(); peerIt != peerMap_.end(); ++peerIt )
+        delete this->currentGamestate_;
+    for( const auto& mapEntry : gamestateQueue )
+      delete mapEntry.second;
+    for( const auto& mapEntryPeer : peerMap_ )
     {
-      for( gamestateIt = peerIt->second.gamestates.begin(); gamestateIt != peerIt->second.gamestates.end(); ++gamestateIt )
-        delete gamestateIt->second;
+      for( const auto& mapEntryGamestate : mapEntryPeer.second.gamestates )
+        delete mapEntryGamestate.second;
     }
 //     this->trafficControl_->destroy();
 //     delete this->threadMutex_;
@@ -106,13 +104,12 @@
   {
     if( this->gamestateQueue.empty() )
         return true;
-    std::map<unsigned int, packet::Gamestate*>::iterator it;
     // now push only the most recent gamestates we received (ignore obsolete ones)
-    for(it = gamestateQueue.begin(); it!=gamestateQueue.end(); it++)
+    for(const auto& mapEntry : gamestateQueue)
     {
-      OrxVerify(processGamestate(it->second), "ERROR: could not process Gamestate");
-      sendAck( it->second->getID(), it->second->getPeerID() );
-      delete it->second;
+      OrxVerify(processGamestate(mapEntry.second), "ERROR: could not process Gamestate");
+      sendAck( mapEntry.second->getID(), mapEntry.second->getPeerID() );
+      delete mapEntry.second;
     }
     // now clear the queue
     gamestateQueue.clear();
@@ -176,19 +173,18 @@
       return std::vector<packet::Gamestate*>();
     std::vector<packet::Gamestate*> peerGamestates;
     
-    std::map<uint32_t, peerInfo>::iterator peerIt;
-    for( peerIt=peerMap_.begin(); peerIt!=peerMap_.end(); ++peerIt )
+    for( const auto& mapEntry : peerMap_ )
     {
-      if( !peerIt->second.isSynched )
+      if( !mapEntry.second.isSynched )
       {
         orxout(verbose_more, context::network) << "Server: not sending gamestate" << endl;
         continue;
       }
-      orxout(verbose_more, context::network) << "client id: " << peerIt->first << endl;
+      orxout(verbose_more, context::network) << "client id: " << mapEntry.first << endl;
       orxout(verbose_more, context::network) << "Server: doing gamestate gamestate preparation" << endl;
-      int peerID = peerIt->first; //get client id
+      int peerID = mapEntry.first; //get client id
 
-      unsigned int lastAckedGamestateID = peerIt->second.lastAckedGamestateID;
+      unsigned int lastAckedGamestateID = mapEntry.second.lastAckedGamestateID;
 
       packet::Gamestate* baseGamestate=nullptr;
       if(lastAckedGamestateID != GAMESTATEID_INITIAL)
@@ -339,10 +335,9 @@
   void GamestateManager::removePeer(uint32_t peerID)
   {
     assert(peerMap_.find(peerID)!=peerMap_.end());
-    std::map<uint32_t, packet::Gamestate*>::iterator peerIt;
-    for( peerIt = peerMap_[peerID].gamestates.begin(); peerIt!=peerMap_[peerID].gamestates.end(); ++peerIt )
+    for( const auto& mapEntry : peerMap_[peerID].gamestates )
     {
-      delete peerIt->second;
+      delete mapEntry.second;
     }
     peerMap_.erase(peerMap_.find(peerID));
   }

Modified: code/branches/cpp11_v2/src/libraries/network/Host.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/Host.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/network/Host.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -106,8 +106,8 @@
    */
   void Host::doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID)
   {
-    for (ObjectList<NetworkChatListener>::iterator it = ObjectList<NetworkChatListener>::begin(); it != ObjectList<NetworkChatListener>::end(); ++it)
-      it->incomingChat(message, sourceID);
+    for (NetworkChatListener* listener : ObjectList<NetworkChatListener>())
+      listener->incomingChat(message, sourceID);
   }
 
 

Modified: code/branches/cpp11_v2/src/libraries/network/MasterServer.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/MasterServer.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/network/MasterServer.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -48,17 +48,13 @@
   void
   MasterServer::listServers( void )
   {
-    /* get an iterator */
-    std::list<ServerListElem>::iterator i;
-
     /* print list header */
     orxout(user_info) << "List of connected servers" << std::endl;
 
     /* loop through list elements */
-    for( i = MasterServer::getInstance()->mainlist.serverlist.begin();
-      i != MasterServer::getInstance()->mainlist.serverlist.end(); ++i )
+    for( const ServerListElem& elem : MasterServer::getInstance()->mainlist.serverlist )
     {
-      orxout(user_info) << "  " << (*i).ServerInfo.getServerIP() << std::endl;
+      orxout(user_info) << "  " << elem.ServerInfo.getServerIP() << std::endl;
     }
 
     /* display end of list */
@@ -111,26 +107,22 @@
   void
   MasterServer::helper_sendlist( ENetEvent *event )
   {
-    /* get an iterator */
-    std::list<ServerListElem>::iterator i;
-
     /* packet holder */
     ENetPacket *reply;
 
     /* loop through list elements */
-    for( i = mainlist.serverlist.begin(); i
-        != mainlist.serverlist.end(); ++i )
+    for( const ServerListElem& elem : mainlist.serverlist )
     {
       /* send this particular server */
       /* build reply string */
-      int packetlen = MSPROTO_SERVERLIST_ITEM_LEN + 1 + (*i).ServerInfo.getServerIP().length() + 1 + (*i).ServerInfo.getServerName().length() + 1 + sizeof((*i).ServerInfo.getClientNumber()) + 1;
+      int packetlen = MSPROTO_SERVERLIST_ITEM_LEN + 1 + elem.ServerInfo.getServerIP().length() + 1 + elem.ServerInfo.getServerName().length() + 1 + sizeof(elem.ServerInfo.getClientNumber()) + 1;
       char *tosend = (char *)calloc(packetlen ,1 );
       if( !tosend )
       { orxout(internal_warning, context::master_server) << "Masterserver.cc: Memory allocation failed." << endl;
         continue;
       }
       sprintf( tosend, "%s %s %s %u", MSPROTO_SERVERLIST_ITEM,
-          (*i).ServerInfo.getServerIP().c_str(), (*i).ServerInfo.getServerName().c_str(), (*i).ServerInfo.getClientNumber());
+          elem.ServerInfo.getServerIP().c_str(), elem.ServerInfo.getServerName().c_str(), elem.ServerInfo.getClientNumber());
 
       /* create packet from it */
       reply = enet_packet_create( tosend,
@@ -166,23 +158,19 @@
   void
   MasterServer::helper_cleanupServers( void )
   {
-    /* get an iterator */
-    std::list<ServerListElem>::iterator i;
-
     if( mainlist.serverlist.size() == 0 )
       return;
 
     /* loop through list elements */
-    for( i = mainlist.serverlist.begin(); i
-        != mainlist.serverlist.end(); ++i )
+    for( const ServerListElem& elem : mainlist.serverlist )
     { /* see if we have a disconnected peer */
-      if( (*i).peer &&
-         ((*i).peer->state == ENET_PEER_STATE_DISCONNECTED ||
-          (*i).peer->state == ENET_PEER_STATE_ZOMBIE ))
+      if( elem.peer &&
+         (elem.peer->state == ENET_PEER_STATE_DISCONNECTED ||
+          elem.peer->state == ENET_PEER_STATE_ZOMBIE ))
       {
         /* Remove it from the list */
-        orxout(internal_warning) << (char*)(*i).peer->data << " timed out.\n";
-        mainlist.delServerByName( (*i).ServerInfo.getServerName() );
+        orxout(internal_warning) << (char*)elem.peer->data << " timed out.\n";
+        mainlist.delServerByName( elem.ServerInfo.getServerName() );
 
         /* stop iterating, we manipulated the list */
         /* TODO note: this only removes one dead server per loop

Modified: code/branches/cpp11_v2/src/libraries/network/PeerList.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/PeerList.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/network/PeerList.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -64,14 +64,12 @@
 
   bool
   PeerList::remPeerByAddr( ENetAddress addr )
-  { /* get an iterator */
-    std::list<ENetPeer *>::iterator i;
-
+  {
     /* loop through list elements */
-    for( i = peerlist.begin(); i != peerlist.end(); ++i )
-      if( !sub_compAddr((*i)->address, addr ) )
+    for( ENetPeer* peer : peerlist )
+      if( !sub_compAddr(peer->address, addr ) )
       { /* found this name, remove and quit */
-        this->peerlist.remove( *i );
+        this->peerlist.remove( peer );
         return true;
       }
 
@@ -81,14 +79,12 @@
 
   ENetPeer *
   PeerList::findPeerByAddr( ENetAddress addr )
-  { /* get an iterator */
-    std::list<ENetPeer *>::iterator i;
-
+  {
     /* loop through list elements */
-    for( i = peerlist.begin(); i != peerlist.end(); ++i )
-      if( !sub_compAddr((*i)->address, addr ) )
+    for( ENetPeer* peer : peerlist )
+      if( !sub_compAddr(peer->address, addr ) )
         /* found this name, remove and quit */
-        return *i;
+        return peer;
 
     /* not found */
     return nullptr;

Modified: code/branches/cpp11_v2/src/libraries/network/Server.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/Server.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/network/Server.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -231,10 +231,9 @@
   bool Server::sendGameStates()
   {
     std::vector<packet::Gamestate*> gamestates = GamestateManager::getGamestates();
-    std::vector<packet::Gamestate*>::iterator it;
-    for( it = gamestates.begin(); it != gamestates.end(); ++it )
+    for( packet::Gamestate* gamestate : gamestates )
     {
-      (*it)->send(static_cast<Host*>(this));
+      gamestate->send(static_cast<Host*>(this));
     }
     return true;
   }
@@ -433,9 +432,8 @@
     if (targetID == NETWORK_PEER_ID_BROADCAST || targetID == NETWORK_PEER_ID_SERVER)
       return true;
 
-    std::vector<uint32_t>::iterator it;
-    for( it=this->clientIDs_.begin(); it!=this->clientIDs_.end(); ++it )
-      if( *it == targetID )
+    for( uint32_t id : this->clientIDs_ )
+      if( id == targetID )
         return true;
 
     return false;

Modified: code/branches/cpp11_v2/src/libraries/network/packet/ClassID.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/packet/ClassID.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/network/packet/ClassID.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -54,9 +54,8 @@
   std::queue<std::pair<uint32_t, std::string>> tempQueue;
 
   //calculate total needed size (for all strings and integers)
-  std::map<std::string, Identifier*>::const_iterator it = IdentifierManager::getInstance().getIdentifierByStringMap().begin();
-  for(;it != IdentifierManager::getInstance().getIdentifierByStringMap().end();++it){
-    id = it->second;
+  for(const auto& mapEntry : IdentifierManager::getInstance().getIdentifierByStringMap()){
+    id = mapEntry.second;
     if(id == nullptr || !id->hasFactory())
       continue;
     const std::string& classname = id->getName();

Modified: code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -212,25 +212,23 @@
   if(this->getID()%1000==1)
   {
     std::list<uint32_t> v1;
-    ObjectList<Synchronisable>::iterator it;
-    for (it = ObjectList<Synchronisable>::begin(); it != ObjectList<Synchronisable>::end(); ++it)
+    for (Synchronisable* synchronisable : ObjectList<Synchronisable>())
     {
-      if (it->getObjectID() == OBJECTID_UNKNOWN)
+      if (synchronisable->getObjectID() == OBJECTID_UNKNOWN)
       {
-        if (it->objectMode_ != 0x0)
+        if (synchronisable->objectMode_ != 0x0)
         {
           orxout(user_error, context::packets) << "Found object with OBJECTID_UNKNOWN on the client with objectMode != 0x0!" << endl;
           orxout(user_error, context::packets) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << endl;
-          orxout(user_error, context::packets) << "Objects class: " << it->getIdentifier()->getName() << endl;
+          orxout(user_error, context::packets) << "Objects class: " << synchronisable->getIdentifier()->getName() << endl;
           assert(false);
         }
       }
       else
       {
-        std::list<uint32_t>::iterator it2;
-        for (it2 = v1.begin(); it2 != v1.end(); ++it2)
+        for (uint32_t id : v1)
         {
-          if (it->getObjectID() == *it2)
+          if (synchronisable->getObjectID() == id)
           {
             orxout(user_error, context::packets) << "Found duplicate objectIDs on the client!" << endl
                                                  << "Are you sure you don't create a Sychnronisable objcect with 'new' \
@@ -238,7 +236,7 @@
             assert(false);
           }
         }
-        v1.push_back(it->getObjectID());
+        v1.push_back(synchronisable->getObjectID());
       }
     }
   }
@@ -761,12 +759,10 @@
 {
   uint32_t size = 0;
   uint32_t nrOfVariables = 0;
-    // get the start of the Synchronisable list
-  ObjectList<Synchronisable>::iterator it;
     // get total size of gamestate
-  for(it = ObjectList<Synchronisable>::begin(); it; ++it){
-    size+=it->getSize(id, mode); // size of the actual data of the synchronisable
-    nrOfVariables += it->getNrOfVariables();
+  for(Synchronisable* synchronisable : ObjectList<Synchronisable>()){
+    size+=synchronisable->getSize(id, mode); // size of the actual data of the synchronisable
+    nrOfVariables += synchronisable->getNrOfVariables();
   }
 //   orxout() << "allocating " << nrOfVariables << " ints" << endl;
   this->sizes_.reserve(nrOfVariables);

Modified: code/branches/cpp11_v2/src/libraries/network/packet/ServerInformation.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/packet/ServerInformation.h	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/network/packet/ServerInformation.h	2015-12-05 21:47:51 UTC (rev 10919)
@@ -49,12 +49,12 @@
 
         void          send( ENetPeer* peer );
         void          setServerName(std::string name) { this->serverName_ = name; }
-        std::string   getServerName() { return this->serverName_; }
+        std::string   getServerName() const { return this->serverName_; }
         void          setServerIP( std::string IP ) { this->serverIP_ = IP; }
-        std::string   getServerIP() { return this->serverIP_; }
+        std::string   getServerIP() const { return this->serverIP_; }
         void          setClientNumber( int clientNumber ) { this->clientNumber_ = clientNumber; }
-        int           getClientNumber() { return this->clientNumber_; }
-        uint32_t      getServerRTT() { return this->serverRTT_; }
+        int           getClientNumber() const { return this->clientNumber_; }
+        uint32_t      getServerRTT() const { return this->serverRTT_; }
 
       private:
         std::string   serverName_;

Modified: code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -265,7 +265,6 @@
     assert(ClassByID(this->classID_));
     assert(this->classID_==this->getIdentifier()->getNetworkID());
     assert(this->objectID_!=OBJECTID_UNKNOWN);
-    std::vector<SynchronisableVariableBase*>::iterator i;
 
     // start copy header
     SynchronisableHeader header(mem);
@@ -275,9 +274,9 @@
     orxout(verbose_more, context::network) << "getting data from objectID_: " << objectID_ << ", classID_: " << classID_ << endl;
 //     orxout(verbose, context::network) << "objectid: " << this->objectID_ << ":";
     // copy to location
-    for(i=syncList_.begin(); i!=syncList_.end(); ++i)
+    for(SynchronisableVariableBase* variable : syncList_)
     {
-      uint32_t varsize = (*i)->getData( mem, mode );
+      uint32_t varsize = variable->getData( mem, mode );
 //       orxout(verbose, context::network) << " " << varsize;
       tempsize += varsize;
       sizes.push_back(varsize);
@@ -347,11 +346,10 @@
       assert( this->getClassID() == syncHeader2.getClassID() );
       assert( this->getContextID() == syncHeader2.getContextID() );
       mem += SynchronisableHeader::getSize();
-      std::vector<SynchronisableVariableBase *>::iterator i;
-      for(i=syncList_.begin(); i!=syncList_.end(); ++i)
+      for(SynchronisableVariableBase* variable : syncList_)
       {
         assert( mem <= data+syncHeader2.getDataSize()+SynchronisableHeader::getSize() ); // always make sure we don't exceed the datasize in our stream
-        (*i)->putData( mem, mode, forceCallback );
+        variable->putData( mem, mode, forceCallback );
       }
       assert(mem == data+syncHeaderLight.getDataSize()+SynchronisableHeader::getSize() );
     }
@@ -387,10 +385,9 @@
       return 0;
     assert( mode==state_ );
     tsize += this->dataSize_;
-    std::vector<SynchronisableVariableBase*>::iterator i;
-    for(i=stringList_.begin(); i!=stringList_.end(); ++i)
+    for(SynchronisableVariableBase* variable : stringList_)
     {
-      tsize += (*i)->getSize( mode );
+      tsize += variable->getSize( mode );
     }
     return tsize;
   }

Modified: code/branches/cpp11_v2/src/libraries/tools/interfaces/ToolsInterfaceCompilation.cc
===================================================================
--- code/branches/cpp11_v2/src/libraries/tools/interfaces/ToolsInterfaceCompilation.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/tools/interfaces/ToolsInterfaceCompilation.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -59,8 +59,8 @@
 
         float oldFactor = TimeFactorListener::timefactor_s;
         TimeFactorListener::timefactor_s = factor;
-        for (ObjectList<TimeFactorListener>::iterator it = ObjectList<TimeFactorListener>::begin(); it != ObjectList<TimeFactorListener>::end(); ++it)
-            it->changedTimeFactor(factor, oldFactor);
+        for (TimeFactorListener* listener : ObjectList<TimeFactorListener>())
+            listener->changedTimeFactor(factor, oldFactor);
     }
 
     //----------------------------

Modified: code/branches/cpp11_v2/src/libraries/util/Serialise.h
===================================================================
--- code/branches/cpp11_v2/src/libraries/util/Serialise.h	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/libraries/util/Serialise.h	2015-12-05 21:47:51 UTC (rev 10919)
@@ -678,10 +678,9 @@
 
     template <class T> inline void saveAndIncrease(  const std::set<T>& variable, uint8_t*& mem )
     {
-        typename std::set<T>::const_iterator it = variable.begin();
         saveAndIncrease( (uint32_t)variable.size(), mem );
-        for( ; it!=variable.end(); ++it )
-            saveAndIncrease( *it, mem );
+        for( const T& elem : variable )
+            saveAndIncrease( elem, mem );
     }
 
     template <class T> inline void loadAndIncrease(std::set<T>& variable, uint8_t*& mem )

Modified: code/branches/cpp11_v2/src/modules/docking/Dock.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/docking/Dock.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/docking/Dock.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -213,9 +213,9 @@
     void Dock::cmdDock()
     {
         PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
-        for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
+        for(Dock* dock : ObjectList<Dock>())
         {
-            if(it->dock(player))
+            if(dock->dock(player))
                 break;
         }
     }
@@ -223,9 +223,9 @@
     void Dock::cmdUndock()
     {
         PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
-        for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
+        for(Dock* dock : ObjectList<Dock>())
         {
-            if(it->undock(player))
+            if(dock->undock(player))
                 break;
         }
     }
@@ -294,9 +294,9 @@
     {
         int i = 0;
         PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
-        for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
+        for(Dock* dock : ObjectList<Dock>())
         {
-            if(it->candidates_.find(player) != it->candidates_.end())
+            if(dock->candidates_.find(player) != dock->candidates_.end())
                 i++;
         }
         return i;
@@ -305,12 +305,12 @@
     Dock* Dock::getActiveDockAtIndex(unsigned int index)
     {
         PlayerInfo* player = HumanController::getLocalControllerSingleton()->getPlayer();
-        for(ObjectList<Dock>::iterator it = ObjectList<Dock>::begin(); it != ObjectList<Dock>::end(); ++it)
+        for(Dock* dock : ObjectList<Dock>())
         {
-            if(it->candidates_.find(player) != it->candidates_.end())
+            if(dock->candidates_.find(player) != dock->candidates_.end())
             {
                 if(index == 0)
-                    return *it;
+                    return dock;
                 index--;
             }
         }

Modified: code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/docking/DockingEffect.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -64,10 +64,10 @@
     }
 
     DockingTarget *DockingEffect::findTarget(std::string name) {
-        for (ObjectList<DockingTarget>::iterator it = ObjectList<DockingTarget>::begin(); it != ObjectList<DockingTarget>::end(); ++it)
+        for (DockingTarget* target : ObjectList<DockingTarget>())
         {
-            if ((*it)->getName().compare(name) == 0)
-                return (*it);
+            if (target->getName().compare(name) == 0)
+                return target;
         }
         return nullptr;
     }

Modified: code/branches/cpp11_v2/src/modules/dodgerace/DodgeRace.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/dodgerace/DodgeRace.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/dodgerace/DodgeRace.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -135,9 +135,9 @@
     {
         if (player == nullptr)
         {
-            for (ObjectList<DodgeRaceShip>::iterator it = ObjectList<DodgeRaceShip>::begin(); it != ObjectList<DodgeRaceShip>::end(); ++it)
+            for (DodgeRaceShip* ship : ObjectList<DodgeRaceShip>())
             {
-                player = *it;
+                player = ship;
             }
         }
         return player;

Modified: code/branches/cpp11_v2/src/modules/dodgerace/DodgeRaceShip.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/dodgerace/DodgeRaceShip.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/dodgerace/DodgeRaceShip.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -153,9 +153,9 @@
     {
         if (game == nullptr)
         {
-            for (ObjectList<DodgeRace>::iterator it = ObjectList<DodgeRace>::begin(); it != ObjectList<DodgeRace>::end(); ++it)
+            for (DodgeRace* race : ObjectList<DodgeRace>())
             {
-                game = *it;
+                game = race;
             }
         }
         return game;

Modified: code/branches/cpp11_v2/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/gametypes/SpaceRace.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/gametypes/SpaceRace.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -87,15 +87,15 @@
             this->spawnPlayersIfRequested();
             this->cantMove_ = true;
 
-            for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
-                it->setActive(false);
+            for (Engine* engine : ObjectList<Engine>())
+                engine->setActive(false);
         }
 
         // activate the engines again if the countdown ends
         if (!this->isStartCountdownRunning() && this->cantMove_)
         {
-            for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
-                it->setActive(true);
+            for (Engine* engine : ObjectList<Engine>())
+                engine->setActive(true);
 
             this->cantMove_= false;
 

Modified: code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/gametypes/SpaceRaceController.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -60,10 +60,10 @@
         virtualCheckPointIndex = -2;
         if (ObjectList<SpaceRaceManager>::size() != 1)
             orxout(internal_warning) << "Expected 1 instance of SpaceRaceManager but found " << ObjectList<SpaceRaceManager>::size() << endl;
-        for (ObjectList<SpaceRaceManager>::iterator it = ObjectList<SpaceRaceManager>::begin(); it != ObjectList<SpaceRaceManager>::end(); ++it)
+        for (SpaceRaceManager* manager : ObjectList<SpaceRaceManager>())
         {
-            checkpoints = it->getAllCheckpoints();
-            nextRaceCheckpoint_ = it->findCheckpoint(0);
+            checkpoints = manager->getAllCheckpoints();
+            nextRaceCheckpoint_ = manager->findCheckpoint(0);
         }
 
         OrxAssert(!checkpoints.empty(), "No Checkpoints in Level");
@@ -186,17 +186,17 @@
         else
         {
             int numberOfWays = 0; // counts number of ways from this Point to the last point
-            for (std::set<int>::iterator it = currentCheckpoint->getNextCheckpoints().begin(); it!= currentCheckpoint->getNextCheckpoints().end(); ++it)
+            for (int checkpointIndex : currentCheckpoint->getNextCheckpoints())
             {
-                if (currentCheckpoint == findCheckpoint(*it))
+                if (currentCheckpoint == findCheckpoint(checkpointIndex))
                 {
                     //orxout() << currentCheckpoint->getCheckpointIndex()<<endl;
                     continue;
                 }
-                if (findCheckpoint(*it) == nullptr)
-                    orxout(internal_warning) << "Problematic Point: " << (*it) << endl;
+                if (findCheckpoint(checkpointIndex) == nullptr)
+                    orxout(internal_warning) << "Problematic Point: " << checkpointIndex << endl;
                 else
-                    numberOfWays += rekSimulationCheckpointsReached(findCheckpoint(*it), zaehler);
+                    numberOfWays += rekSimulationCheckpointsReached(findCheckpoint(checkpointIndex), zaehler);
             }
             zaehler[currentCheckpoint] += numberOfWays;
             return numberOfWays; // returns the number of ways from this point to the last one
@@ -254,11 +254,11 @@
         else
         {
             float minimum = std::numeric_limits<float>::max();
-            for (std::set<int>::iterator it = currentCheckPoint->getNextCheckpoints().begin(); it != currentCheckPoint->getNextCheckpoints().end(); ++it)
+            for (int checkpointIndex : currentCheckPoint->getNextCheckpoints())
             {
                 int dist_currentCheckPoint_currentPosition = static_cast<int> ((currentPosition- currentCheckPoint->getPosition()).length());
 
-                minimum = std::min(minimum, dist_currentCheckPoint_currentPosition + recCalculateDistance(findCheckpoint(*it), currentCheckPoint->getPosition()));
+                minimum = std::min(minimum, dist_currentCheckPoint_currentPosition + recCalculateDistance(findCheckpoint(checkpointIndex), currentCheckPoint->getPosition()));
                 // minimum of distanz from 'currentPosition' to the next static Checkpoint
             }
             return minimum;

Modified: code/branches/cpp11_v2/src/modules/invader/Invader.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/invader/Invader.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/invader/Invader.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -97,8 +97,8 @@
     {
         if (player == nullptr)
         {
-            for (ObjectList<InvaderShip>::iterator it = ObjectList<InvaderShip>::begin(); it != ObjectList<InvaderShip>::end(); ++it)
-                player = *it;
+            for (InvaderShip* ship : ObjectList<InvaderShip>())
+                player = ship;
         }
         return player;
     }

Modified: code/branches/cpp11_v2/src/modules/invader/InvaderEnemy.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/invader/InvaderEnemy.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/invader/InvaderEnemy.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -74,8 +74,8 @@
     {
         if (game == nullptr)
         {
-            for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
-                game = *it;
+            for (Invader* invader : ObjectList<Invader>())
+                game = invader;
         }
         return game;
     }

Modified: code/branches/cpp11_v2/src/modules/invader/InvaderShip.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/invader/InvaderShip.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/invader/InvaderShip.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -183,8 +183,8 @@
     {
         if (game == nullptr)
         {
-            for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
-                game = *it;
+            for (Invader* invader : ObjectList<Invader>())
+                game = invader;
         }
         return game;
     }

Modified: code/branches/cpp11_v2/src/modules/jump/JumpProjectile.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/jump/JumpProjectile.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/jump/JumpProjectile.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -68,15 +68,15 @@
 
         Vector3 projectilePosition = getPosition();
 
-        for (ObjectList<JumpEnemy>::iterator it = ObjectList<JumpEnemy>::begin(); it != ObjectList<JumpEnemy>::end(); ++it)
+        for (JumpEnemy* enemy : ObjectList<JumpEnemy>())
         {
-            Vector3 enemyPosition = it->getPosition();
-            float enemyWidth = it->getWidth();
-            float enemyHeight = it->getHeight();
+            Vector3 enemyPosition = enemy->getPosition();
+            float enemyWidth = enemy->getWidth();
+            float enemyHeight = enemy->getHeight();
 
             if(projectilePosition.x > enemyPosition.x-enemyWidth && projectilePosition.x < enemyPosition.x+enemyWidth && projectilePosition.z > enemyPosition.z-enemyHeight && projectilePosition.z < enemyPosition.z+enemyHeight)
             {
-                it->dead_ = true;
+                enemy->dead_ = true;
             }
         }
     }

Modified: code/branches/cpp11_v2/src/modules/objects/Attacher.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/Attacher.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/objects/Attacher.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -100,12 +100,12 @@
         if (this->targetname_.empty())
             return;
 
-        for (ObjectList<WorldEntity>::iterator it = ObjectList<WorldEntity>::begin(); it != ObjectList<WorldEntity>::end(); ++it)
+        for (WorldEntity* worldEntity : ObjectList<WorldEntity>())
         {
-            if (it->getName() == this->targetname_)
+            if (worldEntity->getName() == this->targetname_)
             {
-                this->target_ = *it;
-                this->attachToParent(*it);
+                this->target_ = worldEntity;
+                this->attachToParent(worldEntity);
             }
         }
     }

Modified: code/branches/cpp11_v2/src/modules/objects/ForceField.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/ForceField.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/objects/ForceField.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -117,21 +117,21 @@
         if(this->mode_ == forceFieldMode::tube)
         {
             // Iterate over all objects that could possibly be affected by the ForceField.
-            for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
+            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
             {
                 // The direction of the orientation of the force field.
                 Vector3 direction = this->getOrientation() * WorldEntity::FRONT;
                 direction.normalise();
 
                 // Vector from the center of the force field to the object its acting on.
-                Vector3 distanceVector = it->getWorldPosition() - (this->getWorldPosition() + (this->halfLength_ * direction));
+                Vector3 distanceVector = mobileEntity->getWorldPosition() - (this->getWorldPosition() + (this->halfLength_ * direction));
 
                 // The object is outside a ball around the center with radius length/2 of the ForceField.
                 if(distanceVector.length() > this->halfLength_)
                     continue;
 
                 // The distance of the object form the orientation vector. (Or rather the smallest distance from the orientation vector)
-                float distanceFromDirectionVector = ((it->getWorldPosition() - this->getWorldPosition()).crossProduct(direction)).length();
+                float distanceFromDirectionVector = ((mobileEntity->getWorldPosition() - this->getWorldPosition()).crossProduct(direction)).length();
 
                 // If the object in a tube of radius 'radius' around the direction of orientation.
                 if(distanceFromDirectionVector >= this->radius_)
@@ -139,31 +139,31 @@
 
                 // Apply a force to the object in the direction of the orientation.
                 // The force is highest when the object is directly on the direction vector, with a linear decrease, finally reaching zero, when distanceFromDirectionVector = radius.
-                it->applyCentralForce((this->radius_ - distanceFromDirectionVector)/this->radius_ * this->velocity_ * direction);
+                mobileEntity->applyCentralForce((this->radius_ - distanceFromDirectionVector)/this->radius_ * this->velocity_ * direction);
             }
         }
         else if(this->mode_ == forceFieldMode::sphere)
         {
             // Iterate over all objects that could possibly be affected by the ForceField.
-            for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
+            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
             {
-                Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition();
+                Vector3 distanceVector = mobileEntity->getWorldPosition() - this->getWorldPosition();
                 float distance = distanceVector.length();
                 // If the object is within 'radius' distance.
                 if (distance < this->radius_)
                 {
                     distanceVector.normalise();
                     // Apply a force proportional to the velocity, with highest force at the origin of the sphere, linear decreasing until reaching a distance of 'radius' from the origin, where the force reaches zero. 
-                    it->applyCentralForce((this->radius_ - distance)/this->radius_ * this->velocity_ * distanceVector);
+                    mobileEntity->applyCentralForce((this->radius_ - distance)/this->radius_ * this->velocity_ * distanceVector);
                 }
             }
         }
         else if(this->mode_ == forceFieldMode::invertedSphere)
         {
             // Iterate over all objects that could possibly be affected by the ForceField.
-            for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
+            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
             {
-                Vector3 distanceVector = this->getWorldPosition() - it->getWorldPosition();
+                Vector3 distanceVector = this->getWorldPosition() - mobileEntity->getWorldPosition();
                 float distance = distanceVector.length();
                 // If the object is within 'radius' distance and no more than 'length' away from the boundary of the sphere.
                 float range = this->radius_ - this->halfLength_*2;
@@ -171,16 +171,16 @@
                 {
                     distanceVector.normalise();
                     // Apply a force proportional to the velocity, with highest force at the boundary of the sphere, linear decreasing until reaching a distance of 'radius-length' from the origin, where the force reaches zero.
-                    it->applyCentralForce((distance-range)/range * this->velocity_ * distanceVector);
+                    mobileEntity->applyCentralForce((distance-range)/range * this->velocity_ * distanceVector);
                 }
             }
         }
         else if(this->mode_ == forceFieldMode::newtonianGravity)
         {
             // Iterate over all objects that could possibly be affected by the ForceField.
-            for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
+            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
             {
-                Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition();
+                Vector3 distanceVector = mobileEntity->getWorldPosition() - this->getWorldPosition();
                 float distance = distanceVector.length();
                 // If the object is within 'radius' distance and especially further away than massRadius_
                 if (distance < this->radius_ && distance > this->massRadius_)
@@ -196,22 +196,22 @@
                      */
                     
                     // Note: this so called force is actually an acceleration!
-                    it->applyCentralForce((-1) * (ForceField::attenFactor_ * ForceField::gravConstant_ * this->getMass()) / (distance * distance) * distanceVector);
+                    mobileEntity->applyCentralForce((-1) * (ForceField::attenFactor_ * ForceField::gravConstant_ * this->getMass()) / (distance * distance) * distanceVector);
                 }
             }
         }
         else if(this->mode_ == forceFieldMode::homogen)
         {
             // Iterate over all objects that could possibly be affected by the ForceField.
-            for (ObjectList<MobileEntity>::iterator it = ObjectList<MobileEntity>::begin(); it != ObjectList<MobileEntity>::end(); ++it)
+            for (MobileEntity* mobileEntity : ObjectList<MobileEntity>())
             {
-                Vector3 distanceVector = it->getWorldPosition() - this->getWorldPosition();
+                Vector3 distanceVector = mobileEntity->getWorldPosition() - this->getWorldPosition();
                 float distance = distanceVector.length();
                 if (distance < this->radius_ && distance > this->massRadius_)
                 {
                     // Add a Acceleration in forceDirection_.
                     // Vector3(0,0,0) is the direction, where the force should work.
-                    it->addAcceleration(forceDirection_ , Vector3(0,0,0));
+                    mobileEntity->addAcceleration(forceDirection_ , Vector3(0,0,0));
                 }
             }
         }

Modified: code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/objects/SpaceBoundaries.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -72,9 +72,8 @@
     void SpaceBoundaries::checkWhoIsIn()
     {
         pawnsIn_.clear();
-        for(ObjectList<Pawn>::iterator current = ObjectList<Pawn>::begin(); current != ObjectList<Pawn>::end(); ++current)
+        for(Pawn* currentPawn : ObjectList<Pawn>())
         {
-            Pawn* currentPawn = *current;
             if( this->reaction_ == 0 )
             {
                 float distance = this->computeDistance(currentPawn);

Modified: code/branches/cpp11_v2/src/modules/objects/controllers/TurretController.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/controllers/TurretController.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/objects/controllers/TurretController.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -102,18 +102,17 @@
         float tempScore;
         Pawn* minScorePawn = nullptr;
 
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+        for (Pawn* pawn : ObjectList<Pawn>())
         {
-            Pawn* entity = orxonox_cast<Pawn*>(*it);
-            if (!entity || FormationController::sameTeam(turret, entity, this->getGametype()))
+            if (!pawn || FormationController::sameTeam(turret, pawn, this->getGametype()))
                 continue;
-            tempScore = turret->isInRange(entity);
+            tempScore = turret->isInRange(pawn);
             if(tempScore != -1.f)
             {
                 if(tempScore < minScore)
                 {
                     minScore = tempScore;
-                    minScorePawn = entity;
+                    minScorePawn = pawn;
                 }
             }
         }

Modified: code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/objects/eventsystem/EventFilter.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -69,9 +69,9 @@
         if (this->names_.size() > 0)
         {
             bool success = false;
-            for (std::list<EventName*>::const_iterator it = this->names_.begin(); it != this->names_.end(); ++it)
+            for (EventName* name : this->names_)
             {
-                if ((*it)->getName() == event.name_)
+                if (name->getName() == event.name_)
                 {
                     success = true;
                     break;

Modified: code/branches/cpp11_v2/src/modules/objects/eventsystem/EventListener.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/eventsystem/EventListener.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/objects/eventsystem/EventListener.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -77,9 +77,9 @@
         if (this->eventName_.empty())
             return;
 
-        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
-            if (it->getName() == this->eventName_)
-                this->addEventSource(*it, "");
+        for (BaseObject* object : ObjectList<BaseObject>())
+            if (object->getName() == this->eventName_)
+                this->addEventSource(object, "");
     }
 
     void EventListener::loadedNewXMLName(BaseObject* object)

Modified: code/branches/cpp11_v2/src/modules/objects/eventsystem/EventTarget.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/eventsystem/EventTarget.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/objects/eventsystem/EventTarget.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -72,9 +72,9 @@
     {
         this->target_ = name;
 
-        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
-            if (it->getName() == this->target_)
-                this->addEventTarget(*it);
+        for (BaseObject* object : ObjectList<BaseObject>())
+            if (object->getName() == this->target_)
+                this->addEventTarget(object);
     }
 
     void EventTarget::loadedNewXMLName(BaseObject* object)

Modified: code/branches/cpp11_v2/src/modules/objects/triggers/Trigger.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/objects/triggers/Trigger.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/objects/triggers/Trigger.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -345,8 +345,8 @@
     void Trigger::debugFlares(bool bVisible)
     {
         // Iterate over all Triggers.
-        for (ObjectList<Trigger>::iterator it = ObjectList<Trigger>::begin(); it != ObjectList<Trigger>::end(); ++it)
-            it->setVisible(bVisible);
+        for (Trigger* trigger : ObjectList<Trigger>())
+            trigger->setVisible(bVisible);
     }
 
     /**

Modified: code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/overlays/hud/HUDRadar.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -164,9 +164,8 @@
     void HUDRadar::gatherObjects()
     {
         const std::set<RadarViewable*>& objectSet = this->getCreator()->getScene()->getRadar()->getRadarObjects();
-        std::set<RadarViewable*>::const_iterator it;
-        for( it=objectSet.begin(); it!=objectSet.end(); ++it )
-            this->addObject(*it);
+        for( RadarViewable* viewable : objectSet )
+            this->addObject(viewable);
         this->radarTick(0);
     }
 
@@ -182,9 +181,7 @@
         const RadarViewable* focusObject = radar->getFocus();
 
         // update the distances for all objects
-        std::map<RadarViewable*,Ogre::PanelOverlayElement*>::iterator it;
 
-
         if(RadarMode_)
         {
             this->setBackgroundMaterial(material3D_);
@@ -200,26 +197,26 @@
             this->map3DBack_->hide();
         }
 
-        for( it = this->radarObjects_.begin(); it != this->radarObjects_.end(); ++it )
+        for( const auto& mapEntry : this->radarObjects_ )
         {
             // Make sure the object really is a WorldEntity
-            const WorldEntity* wePointer = it->first->getWorldEntity();
+            const WorldEntity* wePointer = mapEntry.first->getWorldEntity();
             if( !wePointer )
             {
                 orxout(internal_error) << "Cannot display a non-WorldEntitiy on the radar" << endl;
                 assert(0);
             }
-            bool isFocus = (it->first == focusObject);
+            bool isFocus = (mapEntry.first == focusObject);
             // set size to fit distance...
             float distance = (wePointer->getWorldPosition() - this->owner_->getPosition()).length();
             // calculate the size with 1/distance dependency for simplicity (instead of exp(-distance * lambda)
 
             float size;
             if(RadarMode_)
-                size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
+                size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * mapEntry.first->getRadarObjectScale();
             else
-                size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale();
-            it->second->setDimensions(size, size);
+                size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * mapEntry.first->getRadarObjectScale();
+            mapEntry.second->setDimensions(size, size);
 
             // calc position on radar...
             Vector2 coord;
@@ -233,20 +230,20 @@
 
                 int zOrder = determineMap3DZOrder(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), detectionLimit_);
                 if(overXZPlain == false /*&& (it->second->getZOrder() >  100 * this->overlay_->getZOrder())*/) // it appears that zOrder of attached Overlayelements is 100 times the zOrder of the Overlay
-                    it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 - 70 + zOrder);
+                    mapEntry.second->_notifyZOrder(this->overlay_->getZOrder() * 100 - 70 + zOrder);
                 if(overXZPlain == true /*&& (it->second->getZOrder() <= 100 * this->overlay_->getZOrder())*/)
-                    it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 + 70 + zOrder);
+                    mapEntry.second->_notifyZOrder(this->overlay_->getZOrder() * 100 + 70 + zOrder);
             }
             else
                 coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
 
             coord *= math::pi / 3.5f; // small adjustment to make it fit the texture
-            it->second->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f);
+            mapEntry.second->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f);
 
             if( distance < detectionLimit_ || detectionLimit_ < 0 )
-                it->second->show();
+                mapEntry.second->show();
             else
-                it->second->hide();
+                mapEntry.second->hide();
 
             // if this object is in focus, then set the focus marker
             if (isFocus)
@@ -254,7 +251,7 @@
                 this->marker_->setDimensions(size * 1.5f, size * 1.5f);
                 this->marker_->setPosition((1.0f + coord.x - size * 1.5f) * 0.5f, (1.0f - coord.y - size * 1.5f) * 0.5f);
                 if(RadarMode_)
-                    this->marker_->_notifyZOrder(it->second->getZOrder() -1);
+                    this->marker_->_notifyZOrder(mapEntry.second->getZOrder() -1);
                 this->marker_->show();
             }
         }

Modified: code/branches/cpp11_v2/src/modules/pickup/PickupSpawner.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/pickup/PickupSpawner.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/pickup/PickupSpawner.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -157,18 +157,18 @@
             }
 
             // Iterate trough all Pawns.
-            for(ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+            for(Pawn* pawn : ObjectList<Pawn>())
             {
                 if(spawner == nullptr) // Stop if the PickupSpawner has been deleted (e.g. because it has run out of pickups to distribute).
                     break;
 
-                Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
-                PickupCarrier* carrier = static_cast<PickupCarrier*>(*it);
+                Vector3 distance = pawn->getWorldPosition() - this->getWorldPosition();
+                PickupCarrier* carrier = static_cast<PickupCarrier*>(pawn);
                 // If a PickupCarrier, that fits the target-range of the Pickupable spawned by this PickupSpawner, is in trigger-distance and the carrier is not blocked.
                 if(distance.length() < this->triggerDistance_ && carrier != nullptr && this->blocked_.find(carrier) == this->blocked_.end())
                 {
                     if(carrier->isTarget(this->pickup_))
-                        this->trigger(*it);
+                        this->trigger(pawn);
                 }
             }
         }

Modified: code/branches/cpp11_v2/src/modules/tetris/Tetris.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/tetris/Tetris.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/tetris/Tetris.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -135,9 +135,9 @@
         else if(position.x > (this->center_->getWidth()-0.5)*this->center_->getStoneSize()) //!< If the stone touches the right edge of the level
             return false;
 
-        for(std::list<StrongPtr<TetrisStone>>::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
+        for(TetrisStone* someStone : this->stones_)
         {
-            const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
+            const Vector3& currentStonePosition = someStone->getPosition(); //!< Saves the position of the currentStone
 
             if((position.x == currentStonePosition.x) && abs(position.y-currentStonePosition.y) < this->center_->getStoneSize())
                 return false;
@@ -191,10 +191,10 @@
         assert(stone);
 
         // check for collisions with all stones
-        for(std::list<StrongPtr<TetrisStone>>::const_iterator it = this->stones_.begin(); it != this->stones_.end(); ++it)
+        for(TetrisStone* someStone : this->stones_)
         {
             //Vector3 currentStonePosition = rotateVector((*it)->getPosition(), this->activeBrick_->getRotationCount());
-            const Vector3& currentStonePosition = (*it)->getPosition(); //!< Saves the position of the currentStone
+            const Vector3& currentStonePosition = someStone->getPosition(); //!< Saves the position of the currentStone
 
             //filter out cases where the falling stone is already below a steady stone
             if(position.y < currentStonePosition.y - this->center_->getStoneSize()/2.0f)

Modified: code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseEnemy.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseEnemy.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseEnemy.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -48,8 +48,8 @@
     {
         if (game == nullptr)
         {
-            for (ObjectList<TowerDefense>::iterator it = ObjectList<TowerDefense>::begin(); it != ObjectList<TowerDefense>::end(); ++it)
-                game = *it;
+            for (TowerDefense* towerDefense : ObjectList<TowerDefense>())
+                game = towerDefense;
         }
         return game;
     }

Modified: code/branches/cpp11_v2/src/modules/weapons/projectiles/GravityBombField.cc
===================================================================
--- code/branches/cpp11_v2/src/modules/weapons/projectiles/GravityBombField.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/modules/weapons/projectiles/GravityBombField.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -124,20 +124,20 @@
             }
 
             //Check if any pawn is inside the shockwave and hit it with dammage proportional to the distance between explosion centre and pawn. Make sure, the same pawn is damaged only once.
-            for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+            for (Pawn* pawn : ObjectList<Pawn>())
             {
-                Vector3 distanceVector = it->getWorldPosition()-this->getWorldPosition();
+                Vector3 distanceVector = pawn->getWorldPosition()-this->getWorldPosition();
                  //orxout(debug_output) << "Found Pawn:" << it->getWorldPosition() << endl;
                 if(distanceVector.length()< forceSphereRadius_)
                 {
                     //orxout(debug_output) << "Force sphere radius is: " << forceSphereRadius_ << " Distance to Pawn is: " << distanceVector.length();
-                    if (std::find(victimsAlreadyDamaged_.begin(),victimsAlreadyDamaged_.end(),*it) == victimsAlreadyDamaged_.end())
+                    if (std::find(victimsAlreadyDamaged_.begin(),victimsAlreadyDamaged_.end(),pawn) == victimsAlreadyDamaged_.end())
                     {
                         //orxout(debug_output) << "Found Pawn to damage: " << it->getWorldPosition() << endl;
                         float damage = FORCE_FIELD_EXPLOSION_DAMMAGE*(1-distanceVector.length()/EXPLOSION_RADIUS);
                         //orxout(debug_output) << "Damage: " << damage << endl;
-                        it->hit(shooter_, it->getWorldPosition(), nullptr, damage, 0,0);
-                        victimsAlreadyDamaged_.push_back(*it);
+                        pawn->hit(shooter_, pawn->getWorldPosition(), nullptr, damage, 0,0);
+                        victimsAlreadyDamaged_.push_back(pawn);
                     }
                 }
             }

Modified: code/branches/cpp11_v2/src/orxonox/LevelManager.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/LevelManager.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/LevelManager.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -77,9 +77,8 @@
     LevelManager::~LevelManager()
     {
         // Delete all the LevelInfoItem objects because the LevelManager created them
-        std::set<LevelInfoItem*, LevelInfoCompare>::iterator it = availableLevels_.begin();
-        for (; it != availableLevels_.end(); ++it)
-            delete *it;
+        for (LevelInfoItem* info : availableLevels_)
+            delete info;
     }
 
     /**
@@ -278,9 +277,9 @@
                 Loader::getInstance().load(&file, mask, false, true);
 
                 // Find the LevelInfo object we've just loaded (if there was one)
-                for(ObjectList<LevelInfo>::iterator item = ObjectList<LevelInfo>::begin(); item != ObjectList<LevelInfo>::end(); ++item)
-                    if(item->getXMLFilename() == *it)
-                        info = item->copy();
+                for(LevelInfo* levelInfo : ObjectList<LevelInfo>())
+                    if(levelInfo->getXMLFilename() == *it)
+                        info = levelInfo->copy();
 
                 // We don't need the loaded stuff anymore
                 Loader::getInstance().unload(&file);

Modified: code/branches/cpp11_v2/src/orxonox/MoodManager.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/MoodManager.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/MoodManager.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -102,7 +102,7 @@
 
     /*static*/ void MoodListener::changedMood(const std::string& mood)
     {
-        for (ObjectList<MoodListener>::iterator it = ObjectList<MoodListener>::begin(); it; ++it)
-            it->moodChanged(mood);
+        for (MoodListener* listener : ObjectList<MoodListener>())
+            listener->moodChanged(mood);
     }
 }

Modified: code/branches/cpp11_v2/src/orxonox/PlayerManager.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/PlayerManager.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/PlayerManager.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -110,9 +110,9 @@
         }
         else
         {
-            for (ObjectList<PlayerInfo>::iterator it = ObjectList<PlayerInfo>::begin(); it != ObjectList<PlayerInfo>::end(); ++it)
-                if (it->getClientID() == clientID)
-                    return (*it);
+            for (PlayerInfo* info : ObjectList<PlayerInfo>())
+                if (info->getClientID() == clientID)
+                    return info;
         }
         return nullptr;
     }

Modified: code/branches/cpp11_v2/src/orxonox/Radar.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/Radar.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/Radar.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -83,9 +83,9 @@
         assert( this->radarObjects_.find(rv) == this->radarObjects_.end() );
         this->radarObjects_.insert(rv);
         // iterate through all radarlisteners and notify them
-        for (ObjectList<RadarListener>::iterator itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
+        for (RadarListener* listener : ObjectList<RadarListener>())
         {
-            (*itListener)->addObject(rv);
+            listener->addObject(rv);
         }
     }
 
@@ -94,9 +94,9 @@
         assert( this->radarObjects_.find(rv) != this->radarObjects_.end() );
         this->radarObjects_.erase(rv);
         // iterate through all radarlisteners and notify them
-        for (ObjectList<RadarListener>::iterator itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
+        for (RadarListener* listener : ObjectList<RadarListener>())
         {
-            (*itListener)->removeObject(rv);
+            listener->removeObject(rv);
         }
     }
 
@@ -129,9 +129,9 @@
             this->itFocus_ = nullptr;
         }
 
-        for (ObjectList<RadarListener>::iterator itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
+        for (RadarListener* listener : ObjectList<RadarListener>())
         {
-            (*itListener)->radarTick(dt);
+            listener->radarTick(dt);
         }
     }
 
@@ -199,17 +199,18 @@
         orxout(debug_output) << "List of RadarObjects:" << endl;
         // iterate through all Radar Objects
         unsigned int i = 0;
-        for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it, ++i)
+        for (RadarViewable* viewable : ObjectList<RadarViewable>())
         {
-            orxout(debug_output) << i++ << ": " << (*it)->getRVWorldPosition() << endl;
+            orxout(debug_output) << i++ << ": " << viewable->getRVWorldPosition() << endl;
+            ++i;
         }
     }
 
     void Radar::radarObjectChanged(RadarViewable* rv)
     {
-        for (ObjectList<RadarListener>::iterator itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
+        for (RadarListener* listener : ObjectList<RadarListener>())
         {
-          (*itListener)->objectChanged(rv);
+            listener->objectChanged(rv);
         }
     }
 }

Modified: code/branches/cpp11_v2/src/orxonox/Scene.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/Scene.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/Scene.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -388,7 +388,7 @@
 
     /*static*/ void Scene::consoleCommand_debugDrawPhysics(bool bDraw, bool bFill, float fillAlpha)
     {
-        for (ObjectListIterator<Scene> it = ObjectList<Scene>::begin(); it != ObjectList<Scene>::end(); ++it)
-            it->setDebugDrawPhysics(bDraw, bFill, fillAlpha);
+        for (Scene* scene : ObjectList<Scene>())
+            scene->setDebugDrawPhysics(bDraw, bFill, fillAlpha);
     }
 }

Modified: code/branches/cpp11_v2/src/orxonox/chat/ChatHistory.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/chat/ChatHistory.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/chat/ChatHistory.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -159,13 +159,9 @@
   /* output history for debugging */
   void ChatHistory::debug_printhist()
   {
-    /* create deque iterator */
-    std::deque<std::string>::iterator it;
-
     /* output all the strings */
-    for( it = this->hist_buffer.begin(); it != this->hist_buffer.end();
-      ++it )
-      orxout(debug_output) << *it << endl;
+    for( const std::string& hist : this->hist_buffer )
+      orxout(debug_output) << hist << endl;
 
     /* output size */
     orxout(debug_output) << "Size: " << hist_buffer.size() << endl;

Modified: code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/collisionshapes/CompoundCollisionShape.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -199,14 +199,14 @@
         bool bPrimitive = true; // Whether the CompoundCollisionShape has just one non-empty CollisionShape. And that shape also has no transformation.
         bool bEmpty = true; // Whether the CompoundCollisionShape is empty.
         // Iterate over all CollisionShapes that belong to this CompoundCollisionShape.
-        for (std::map<CollisionShape*, btCollisionShape*>::const_iterator it = this->attachedShapes_.begin(); it != this->attachedShapes_.end(); ++it)
+        for (const auto& mapEntry : this->attachedShapes_)
         {
             // TODO: Make sure this is correct.
-            if (it->second)
+            if (mapEntry.second)
             {
                 bEmpty = false;
-                if (!it->first->hasTransform() && bPrimitive)
-                    primitive = it->second;
+                if (!mapEntry.first->hasTransform() && bPrimitive)
+                    primitive = mapEntry.second;
                 else
                 {
                     bPrimitive = false;

Modified: code/branches/cpp11_v2/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/controllers/FormationController.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/controllers/FormationController.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -96,23 +96,23 @@
         {
             this->removeFromFormation();
 
-            for (ObjectList<FormationController>::iterator it = ObjectList<FormationController>::begin(); it; ++it)
+            for (FormationController* controller : ObjectList<FormationController>())
             {
-                if (*it != this)
+                if (controller != this)
                 {
-                    if (it->myMaster_ == this)
+                    if (controller->myMaster_ == this)
                     {
-                        orxout(internal_error) << this << " is still master in " << (*it) << endl;
-                        it->myMaster_ = nullptr;
+                        orxout(internal_error) << this << " is still master in " << controller << endl;
+                        controller->myMaster_ = nullptr;
                     }
 
                     while (true)
                     {
-                        std::vector<FormationController*>::iterator it2 = std::find(it->slaves_.begin(), it->slaves_.end(), this);
-                        if (it2 != it->slaves_.end())
+                        std::vector<FormationController*>::iterator it2 = std::find(controller->slaves_.begin(), controller->slaves_.end(), this);
+                        if (it2 != controller->slaves_.end())
                         {
-                            orxout(internal_error) << this << " is still slave in " << (*it) << endl;
-                            it->slaves_.erase(it2);
+                            orxout(internal_error) << this << " is still slave in " << controller << endl;
+                            controller->slaves_.erase(it2);
                         }
                         else
                             break;
@@ -139,14 +139,14 @@
     */
     void FormationController::formationflight(const bool form)
     {
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        for (Pawn* pawn : ObjectList<Pawn>())
         {
             Controller* controller = nullptr;
 
-            if (it->getController())
-                controller = it->getController();
-            else if (it->getXMLController())
-                controller = it->getXMLController();
+            if (pawn->getController())
+                controller = pawn->getController();
+            else if (pawn->getXMLController())
+                controller = pawn->getXMLController();
 
             if (!controller)
                 continue;
@@ -170,14 +170,14 @@
     */
     void FormationController::masteraction(const int action)
     {
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        for (Pawn* pawn : ObjectList<Pawn>())
         {
             Controller* controller = nullptr;
 
-            if (it->getController())
-                controller = it->getController();
-            else if (it->getXMLController())
-                controller = it->getXMLController();
+            if (pawn->getController())
+                controller = pawn->getController();
+            else if (pawn->getXMLController())
+                controller = pawn->getXMLController();
 
             if (!controller)
                 continue;
@@ -200,14 +200,14 @@
     */
     void FormationController::passivebehaviour(const bool passive)
     {
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        for (Pawn* pawn : ObjectList<Pawn>())
         {
             Controller* controller = nullptr;
 
-            if (it->getController())
-                controller = it->getController();
-            else if (it->getXMLController())
-                controller = it->getXMLController();
+            if (pawn->getController())
+                controller = pawn->getController();
+            else if (pawn->getXMLController())
+                controller = pawn->getXMLController();
 
             if (!controller)
                 continue;
@@ -227,14 +227,14 @@
     */
     void FormationController::formationsize(const int size)
     {
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        for (Pawn* pawn : ObjectList<Pawn>())
         {
             Controller* controller = nullptr;
 
-            if (it->getController())
-                controller = it->getController();
-            else if (it->getXMLController())
-                controller = it->getXMLController();
+            if (pawn->getController())
+                controller = pawn->getController();
+            else if (pawn->getXMLController())
+                controller = pawn->getXMLController();
 
             if (!controller)
                 continue;
@@ -397,31 +397,31 @@
         this->forgetTarget();
         int teamSize = 0;
         //go through all pawns
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        for (Pawn* pawn : ObjectList<Pawn>())
         {
 
             //same team?
             Gametype* gt=this->getGametype();
             if (!gt)
             {
-                gt=it->getGametype();
+                gt=pawn->getGametype();
             }
-            if (!FormationController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it),gt))
+            if (!FormationController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(pawn),gt))
                 continue;
 
             //has it an FormationController?
             Controller* controller = nullptr;
 
-            if (it->getController())
-                controller = it->getController();
-            else if (it->getXMLController())
-                controller = it->getXMLController();
+            if (pawn->getController())
+                controller = pawn->getController();
+            else if (pawn->getXMLController())
+                controller = pawn->getXMLController();
 
             if (!controller)
                 continue;
 
             //is pawn oneself?
-            if (orxonox_cast<ControllableEntity*>(*it) == this->getControllableEntity())
+            if (orxonox_cast<ControllableEntity*>(pawn) == this->getControllableEntity())
                 continue;
 
             teamSize++;
@@ -432,7 +432,7 @@
             if (!newMaster || newMaster->state_ != MASTER)
                 continue;
 
-            float distance = (it->getPosition() - this->getControllableEntity()->getPosition()).length();
+            float distance = (pawn->getPosition() - this->getControllableEntity()->getPosition()).length();
 
             // is pawn in range?
             if (distance < RADIUS_TO_SEARCH_FOR_MASTERS)
@@ -519,9 +519,9 @@
             newMaster->slaves_ = this->slaves_;
             newMaster->myMaster_ = nullptr;
 
-            for(std::vector<FormationController*>::iterator it = newMaster->slaves_.begin(); it != newMaster->slaves_.end(); it++)
+            for(FormationController* slave : newMaster->slaves_)
             {
-                (*it)->myMaster_ = newMaster;
+                slave->myMaster_ = newMaster;
             }
         }
 
@@ -548,9 +548,9 @@
                 newMaster->slaves_ = this->slaves_;
                 newMaster->myMaster_ = nullptr;
 
-                for(std::vector<FormationController*>::iterator it = newMaster->slaves_.begin(); it != newMaster->slaves_.end(); it++)
+                for(FormationController* slave : newMaster->slaves_)
                 {
-                    (*it)->myMaster_ = newMaster;
+                    slave->myMaster_ = newMaster;
                 }
             }
 
@@ -776,21 +776,21 @@
         NewHumanController *currentHumanController = nullptr;
         std::vector<FormationController*> allMasters;
 
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        for (Pawn* pawn : ObjectList<Pawn>())
         {
             Controller* controller = nullptr;
 
-            if (it->getController())
-                controller = it->getController();
-            else if (it->getXMLController())
-                controller = it->getXMLController();
+            if (pawn->getController())
+                controller = pawn->getController();
+            else if (pawn->getXMLController())
+                controller = pawn->getXMLController();
 
             if (!controller)
                 continue;
 
             currentHumanController = orxonox_cast<NewHumanController*>(controller);
 
-            if(currentHumanController) humanPawn = *it;
+            if(currentHumanController) humanPawn = pawn;
 
             FormationController *aiController = orxonox_cast<FormationController*>(controller);
 
@@ -807,11 +807,12 @@
             int index = 0;
             int i = 0;
 
-            for(std::vector<FormationController*>::iterator it = allMasters.begin(); it != allMasters.end(); it++, i++)
+            for(FormationController* master : allMasters)
             {
-                if (!FormationController::sameTeam((*it)->getControllableEntity(), humanPawn, (*it)->getGametype())) continue;
-                distance = posHuman - (*it)->getControllableEntity()->getPosition().length();
+                if (!FormationController::sameTeam(master->getControllableEntity(), humanPawn, master->getGametype())) continue;
+                distance = posHuman - master->getControllableEntity()->getPosition().length();
                 if(distance < minDistance) index = i;
+                i++;
             }
             allMasters[index]->followInit(humanPawn);
         }
@@ -846,16 +847,16 @@
         Pawn *humanPawn = nullptr;
         NewHumanController *currentHumanController = nullptr;
 
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        for (Pawn* pawn : ObjectList<Pawn>())
         {
-            if (!it->getController())
+            if (!pawn->getController())
                 continue;
 
-            currentHumanController = orxonox_cast<NewHumanController*>(it->getController());
+            currentHumanController = orxonox_cast<NewHumanController*>(pawn->getController());
             if(currentHumanController)
             {
-                if (!FormationController::sameTeam(this->getControllableEntity(), *it, this->getGametype())) continue;
-                humanPawn = *it;
+                if (!FormationController::sameTeam(this->getControllableEntity(), pawn, this->getGametype())) continue;
+                humanPawn = pawn;
                 break;
             }
         }
@@ -917,24 +918,24 @@
         this->targetPosition_ = this->getControllableEntity()->getPosition();
         this->forgetTarget();
 
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        for (Pawn* pawn : ObjectList<Pawn>())
         {
-            if (FormationController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
+            if (FormationController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(pawn), this->getGametype()))
                 continue;
 
             /* So AI won't choose invisible Spaceships as target */
-            if (!it->getRadarVisibility())
+            if (!pawn->getRadarVisibility())
                 continue;
 
-            if (static_cast<ControllableEntity*>(*it) != this->getControllableEntity())
+            if (static_cast<ControllableEntity*>(pawn) != this->getControllableEntity())
             {
                 float speed = this->getControllableEntity()->getVelocity().length();
                 Vector3 distanceCurrent = this->targetPosition_ - this->getControllableEntity()->getPosition();
-                Vector3 distanceNew = it->getPosition() - this->getControllableEntity()->getPosition();
-                if (!this->target_ || it->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / math::twoPi)
+                Vector3 distanceNew = pawn->getPosition() - this->getControllableEntity()->getPosition();
+                if (!this->target_ || pawn->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / math::twoPi)
                         < this->targetPosition_.squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / math::twoPi) + rnd(-250, 250))
                 {
-                    this->setTarget(*it);
+                    this->setTarget(pawn);
                 }
             }
         }

Modified: code/branches/cpp11_v2/src/orxonox/controllers/ScriptController.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/controllers/ScriptController.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/controllers/ScriptController.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -120,20 +120,16 @@
       orxout(verbose) << "Great success!" << std::endl;
 
       /* Debugging: print all the scriptcontroller object pointers */
-      for(ObjectList<ScriptController>::iterator it = 
-        ObjectList<ScriptController>::begin(); 
-        it != ObjectList<ScriptController>::end(); ++it)
-      { orxout(verbose) << "Have object in list: " << *it << endl; }
+      for(ScriptController* controller : ObjectList<ScriptController>())
+      { orxout(verbose) << "Have object in list: " << controller << endl; }
 
       /* Find the first one with a nonzero ID */
-      for(ObjectList<ScriptController>::iterator it = 
-        ObjectList<ScriptController>::begin(); 
-        it != ObjectList<ScriptController>::end(); ++it)
+      for(ScriptController* controller : ObjectList<ScriptController>())
       { 
         // TODO: do some selection here. Currently just returns the first one
-        if( (*it)->getID() > 0 )
-        { orxout(verbose) << "Controller to return: " << *it << endl;
-          return *it; 
+        if( controller->getID() > 0 )
+        { orxout(verbose) << "Controller to return: " << controller << endl;
+          return controller;
         }
       
       }

Modified: code/branches/cpp11_v2/src/orxonox/controllers/WaypointPatrolController.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/controllers/WaypointPatrolController.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/controllers/WaypointPatrolController.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -86,16 +86,16 @@
         Vector3 myposition = this->getControllableEntity()->getPosition();
         float shortestsqdistance = (float)static_cast<unsigned int>(-1);
 
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+        for (Pawn* pawn : ObjectList<Pawn>())
         {
-            if (ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
+            if (ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(pawn), this->getGametype()))
                 continue;
 
-            float sqdistance = it->getPosition().squaredDistance(myposition);
+            float sqdistance = pawn->getPosition().squaredDistance(myposition);
             if (sqdistance < shortestsqdistance)
             {
                 shortestsqdistance = sqdistance;
-                this->target_ = (*it);
+                this->target_ = pawn;
             }
         }
 

Modified: code/branches/cpp11_v2/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/gamestates/GSLevel.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/gamestates/GSLevel.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -163,26 +163,26 @@
     {
         // Note: Temporarily moved to GSRoot.
         //// Call the scene objects
-        //for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
-        //    it->tick(time.getDeltaTime() * this->timeFactor_);
+        //for (Tickable* tickable : ObjectList<Tickable>())
+        //    tickable->tick(time.getDeltaTime() * this->timeFactor_);
     }
 
     void GSLevel::prepareObjectTracking()
     {
-        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
-            this->staticObjects_.insert(*it);
+        for (BaseObject* baseObject : ObjectList<BaseObject>())
+            this->staticObjects_.insert(baseObject);
     }
 
     void GSLevel::performObjectTracking()
     {
         orxout(internal_info) << "Remaining objects:" << endl;
         unsigned int i = 0;
-        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); ++it)
+        for (BaseObject* baseObject : ObjectList<BaseObject>())
         {
-            std::set<BaseObject*>::const_iterator find = this->staticObjects_.find(*it);
+            std::set<BaseObject*>::const_iterator find = this->staticObjects_.find(baseObject);
             if (find == this->staticObjects_.end())
             {
-                orxout(internal_warning) << ++i << ": " << it->getIdentifier()->getName() << " (" << *it << "), references: " << it->getReferenceCount() << endl;
+                orxout(internal_warning) << ++i << ": " << baseObject->getIdentifier()->getName() << " (" << baseObject << "), references: " << baseObject->getReferenceCount() << endl;
             }
         }
         if (i == 0)
@@ -234,9 +234,9 @@
     {
         // export all states
         std::vector<GSLevelMementoState*> states;
-        for (ObjectList<GSLevelMemento>::iterator it = ObjectList<GSLevelMemento>::begin(); it != ObjectList<GSLevelMemento>::end(); ++it)
+        for (GSLevelMemento* memento : ObjectList<GSLevelMemento>())
         {
-            GSLevelMementoState* state = it->exportMementoState();
+            GSLevelMementoState* state = memento->exportMementoState();
             if (state)
                 states.push_back(state);
         }
@@ -246,8 +246,8 @@
         this->activate();
 
         // import all states
-        for (ObjectList<GSLevelMemento>::iterator it = ObjectList<GSLevelMemento>::begin(); it != ObjectList<GSLevelMemento>::end(); ++it)
-            it->importMementoState(states);
+        for (GSLevelMemento* memento : ObjectList<GSLevelMemento>())
+            memento->importMementoState(states);
 
         // delete states
         for (GSLevelMementoState* state : states)

Modified: code/branches/cpp11_v2/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/gamestates/GSRoot.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/gamestates/GSRoot.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -73,13 +73,13 @@
     void GSRoot::printObjects()
     {
         unsigned int nr=0;
-        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it; ++it)
+        for (BaseObject* baseObject : ObjectList<BaseObject>())
         {
-            Synchronisable* synchronisable = orxonox_cast<Synchronisable*>(*it);
+            Synchronisable* synchronisable = orxonox_cast<Synchronisable*>(baseObject);
             if (synchronisable)
-                orxout(debug_output) << "object: " << it->getIdentifier()->getName() << " id: " << synchronisable->getObjectID() << endl;
+                orxout(debug_output) << "object: " << baseObject->getIdentifier()->getName() << " id: " << synchronisable->getObjectID() << endl;
             else
-                orxout(debug_output) << "object: " << it->getIdentifier()->getName() << endl;
+                orxout(debug_output) << "object: " << baseObject->getIdentifier()->getName() << endl;
             nr++;
         }
         orxout(debug_output) << "currently got " << nr << " objects" << endl;

Modified: code/branches/cpp11_v2/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/gametypes/Gametype.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/gametypes/Gametype.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -570,11 +570,11 @@
 
         // find correct scene
         Scene* scene = nullptr;
-        for (ObjectList<Scene>::iterator it = ObjectList<Scene>::begin(); it != ObjectList<Scene>::end(); ++it)
+        for (Scene* someScene : ObjectList<Scene>())
         {
-            if (it->getName() == state->sceneName_)
+            if (someScene->getName() == state->sceneName_)
             {
-                scene = *it;
+                scene = someScene;
                 break;
             }
         }

Modified: code/branches/cpp11_v2/src/orxonox/gametypes/Mission.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/gametypes/Mission.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/gametypes/Mission.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -100,9 +100,8 @@
 
     void Mission::setTeams()
     { //Set pawn-colours
-        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+        for (Pawn* pawn : ObjectList<Pawn>())
         {
-            Pawn* pawn = static_cast<Pawn*>(*it);
             if (!pawn)
                 continue;
             this->setDefaultObjectColour(pawn);
@@ -110,18 +109,18 @@
     }
     void Mission::endMission(bool accomplished)
     {
-        for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it)
+        for (Mission* mission : ObjectList<Mission>())
         { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!
-            it->setMissionAccomplished(accomplished);
-            it->end();
+            mission->setMissionAccomplished(accomplished);
+            mission->end();
         }
     }
 
     void Mission::setLivesWrapper(unsigned int amount)
     {
-        for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it)
+        for (Mission* mission : ObjectList<Mission>())
         { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions!
-            it->setLives(amount);
+            mission->setLives(amount);
         }
     }
 }

Modified: code/branches/cpp11_v2/src/orxonox/infos/GametypeInfo.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/infos/GametypeInfo.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/infos/GametypeInfo.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -460,31 +460,31 @@
 
     void GametypeInfo::dispatchAnnounceMessage(const std::string& message) const
     {
-        for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
-            it->announcemessage(this, message);
+        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
+            listener->announcemessage(this, message);
     }
 
     void GametypeInfo::dispatchKillMessage(const std::string& message) const
     {
-        for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
-            it->killmessage(this, message);
+        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
+            listener->killmessage(this, message);
     }
 
     void GametypeInfo::dispatchDeathMessage(const std::string& message) const
     {
-        for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
-            it->deathmessage(this, message);
+        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
+            listener->deathmessage(this, message);
     }
 
      void GametypeInfo::dispatchStaticMessage(const std::string& message, const ColourValue& colour) const
     {
-        for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
-            it->staticmessage(this, message, colour);
+        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
+            listener->staticmessage(this, message, colour);
     }
 
      void GametypeInfo::dispatchFadingMessage(const std::string& message) const
     {
-        for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it)
-            it->fadingmessage(this, message);
+        for (GametypeMessageListener* listener : ObjectList<GametypeMessageListener>())
+            listener->fadingmessage(this, message);
     }
 }

Modified: code/branches/cpp11_v2/src/orxonox/interfaces/NotificationListener.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/interfaces/NotificationListener.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/interfaces/NotificationListener.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -107,18 +107,18 @@
     /*static*/ void NotificationListener::sendHelper(const std::string& message, const std::string& sender, bool isCommand, unsigned int messageType)
     {
         // Iterate through all NotificationListeners and notify them by calling the method they overloaded.
-        for(ObjectList<NotificationListener>::iterator it = ObjectList<NotificationListener>::begin(); it != ObjectList<NotificationListener>::end(); ++it)
+        for(NotificationListener* listener : ObjectList<NotificationListener>())
         {
             // If the notification is a message.
             if(!isCommand)
-                it->registerNotification(message, sender, notificationMessageType::Value(messageType));
+                listener->registerNotification(message, sender, notificationMessageType::Value(messageType));
 
             // If the notification is a command.
             if(isCommand)
             {
                 notificationCommand::Value command = str2Command(message);
                 if(command != notificationCommand::none)
-                    it->executeCommand(command, sender);
+                    listener->executeCommand(command, sender);
             }
         }
     }

Modified: code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/interfaces/PickupCarrier.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -100,9 +100,9 @@
         bool isTarget = false;
         // Go recursively through all children to check whether they are a target.
         std::vector<PickupCarrier*>* children = this->getCarrierChildren();
-        for(std::vector<PickupCarrier*>::const_iterator it = children->begin(); it != children->end(); it++)
+        for(PickupCarrier* carrier : *children)
         {
-            if((*it)->isTarget(pickup))
+            if(carrier->isTarget(pickup))
             {
                 isTarget = true;
                 break;

Modified: code/branches/cpp11_v2/src/orxonox/interfaces/PickupListener.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/interfaces/PickupListener.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/interfaces/PickupListener.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -73,8 +73,8 @@
         assert(pickup);
 
         // Iterate through all PickupListeners and notify them by calling the method they overloaded.
-        for(ObjectList<PickupListener>::iterator it = ObjectList<PickupListener>::begin(); it != ObjectList<PickupListener>::end(); ++it)
-            it->pickupChangedUsed(pickup, used);
+        for(PickupListener* listener : ObjectList<PickupListener>())
+            listener->pickupChangedUsed(pickup, used);
     }
 
     /**
@@ -91,8 +91,8 @@
         assert(pickup);
 
         // Iterate through all PickupListeners and notify them by calling the method they overloaded.
-        for(ObjectList<PickupListener>::iterator it = ObjectList<PickupListener>::begin(); it != ObjectList<PickupListener>::end(); ++it)
-            it->pickupChangedPickedUp(pickup, pickedUp);
+        for(PickupListener* listener : ObjectList<PickupListener>())
+            listener->pickupChangedPickedUp(pickup, pickedUp);
     }
 
 }

Modified: code/branches/cpp11_v2/src/orxonox/items/MultiStateEngine.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/items/MultiStateEngine.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/items/MultiStateEngine.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -84,9 +84,9 @@
             if (!this->getShip())
             {
                 // We have no ship, so the effects are not attached and won't be destroyed automatically
-                for (std::vector<EffectContainer*>::const_iterator it = this->effectContainers_.begin(); it != this->effectContainers_.end(); ++it)
-                    for (std::vector<WorldEntity*>::const_iterator it2 = (*it)->getEffectsBegin(); it2 != (*it)->getEffectsBegin(); ++it2)
-                        (*it2)->destroy();
+                for (EffectContainer* container : this->effectContainers_)
+                    for (std::vector<WorldEntity*>::const_iterator it = container->getEffectsBegin(); it != container->getEffectsBegin(); ++it)
+                        (*it)->destroy();
                 if (this->defEngineSndNormal_)
                     this->defEngineSndNormal_->destroy();
                 if (this->defEngineSndBoost_)
@@ -177,8 +177,8 @@
                 this->oldState_ = this->state_;
 
                 // Update all effect conditions
-                for (std::vector<EffectContainer*>::const_iterator it = this->effectContainers_.begin(); it != this->effectContainers_.end(); ++it)
-                    (*it)->updateCondition();
+                for (EffectContainer* container : this->effectContainers_)
+                    container->updateCondition();
             }
         }
 
@@ -197,9 +197,9 @@
         if( this->defEngineSndBoost_ )
             this->getShip()->attach(defEngineSndBoost_);
 
-        for (std::vector<EffectContainer*>::const_iterator it = this->effectContainers_.begin(); it != this->effectContainers_.end(); ++it)
-            for (std::vector<WorldEntity*>::const_iterator it2 = (*it)->getEffectsBegin(); it2 != (*it)->getEffectsEnd(); ++it2)
-                this->getShip()->attach(*it2);
+        for (EffectContainer* container : this->effectContainers_)
+            for (std::vector<WorldEntity*>::const_iterator it = container->getEffectsBegin(); it != container->getEffectsEnd(); ++it)
+                this->getShip()->attach(*it);
     }
 
     void MultiStateEngine::addEffectContainer(EffectContainer* effect)

Modified: code/branches/cpp11_v2/src/orxonox/overlays/OverlayGroup.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/overlays/OverlayGroup.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/overlays/OverlayGroup.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -169,10 +169,10 @@
     */
     /*static*/ void OverlayGroup::toggleVisibility(const std::string& name)
     {
-        for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
+        for (OverlayGroup* group : ObjectList<OverlayGroup>())
         {
-            if ((*it)->getName() == name)
-                (*it)->setVisible(!((*it)->isVisible()));
+            if (group->getName() == name)
+                group->setVisible(!(group->isVisible()));
         }
     }
     
@@ -184,14 +184,14 @@
     */
     /*static*/ void OverlayGroup::show(const std::string& name)
     {
-        for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
+        for (OverlayGroup* group : ObjectList<OverlayGroup>())
         {
-            if ((*it)->getName() == name)
+            if (group->getName() == name)
             {
-                if((*it)->isVisible())
-                    (*it)->changedVisibility();
+                if(group->isVisible())
+                    group->changedVisibility();
                 else
-                    (*it)->setVisible(!((*it)->isVisible()));
+                    group->setVisible(!(group->isVisible()));
             }
         }
     }
@@ -207,10 +207,10 @@
     */
     /*static*/ void OverlayGroup::scaleGroup(const std::string& name, float scale)
     {
-        for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
+        for (OverlayGroup* group : ObjectList<OverlayGroup>())
         {
-            if ((*it)->getName() == name)
-                (*it)->scale(Vector2(scale, scale));
+            if (group->getName() == name)
+                group->scale(Vector2(scale, scale));
         }
     }
 
@@ -225,10 +225,10 @@
     */
     /*static*/ void OverlayGroup::scrollGroup(const std::string& name, const Vector2& scroll)
     {
-        for (ObjectList<OverlayGroup>::iterator it = ObjectList<OverlayGroup>::begin(); it; ++it)
+        for (OverlayGroup* group : ObjectList<OverlayGroup>())
         {
-            if ((*it)->getName() == name)
-                (*it)->scroll(scroll);
+            if (group->getName() == name)
+                group->scroll(scroll);
         }
     }
 }

Modified: code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/sound/SoundManager.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -293,16 +293,16 @@
         switch(type)
         {
         case SoundType::All:
-            for (ObjectList<BaseSound>::iterator it = ObjectList<BaseSound>::begin(); it != ObjectList<BaseSound>::end(); ++it)
-                (*it)->updateVolume();
+            for (BaseSound* sound : ObjectList<BaseSound>())
+                sound->updateVolume();
             break;
         case SoundType::Music:
-            for (ObjectList<AmbientSound>::iterator it = ObjectList<AmbientSound>::begin(); it != ObjectList<AmbientSound>::end(); ++it)
-                (*it)->updateVolume();
+            for (AmbientSound* sound : ObjectList<AmbientSound>())
+                sound->updateVolume();
             break;
         case SoundType::Effects:
-            for (ObjectList<WorldSound>::iterator it = ObjectList<WorldSound>::begin(); it != ObjectList<WorldSound>::end(); ++it)
-                (*it)->updateVolume();
+            for (WorldSound* sound : ObjectList<WorldSound>())
+                sound->updateVolume();
             break;
         default:
             assert(false);

Modified: code/branches/cpp11_v2/src/orxonox/sound/WorldAmbientSound.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/sound/WorldAmbientSound.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/sound/WorldAmbientSound.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -113,10 +113,9 @@
     {
 
         //HACK: Assuption - there is only one WorldAmbientSound in a level and only one level is used.
-        for (ObjectList<WorldAmbientSound>::iterator it = ObjectList<WorldAmbientSound>::begin();
-             it != ObjectList<WorldAmbientSound>::end(); ++it)
+        for (WorldAmbientSound* sound : ObjectList<WorldAmbientSound>())
         {
-            while(it->ambientSound_->setAmbientSource(WorldAmbientSound::soundList_[WorldAmbientSound::soundNumber_]) == false){
+            while(sound->ambientSound_->setAmbientSource(WorldAmbientSound::soundList_[WorldAmbientSound::soundNumber_]) == false){
                 WorldAmbientSound::soundNumber_ = (WorldAmbientSound::soundNumber_ + 1) % WorldAmbientSound::soundList_.size();
             }
             WorldAmbientSound::soundNumber_ = (WorldAmbientSound::soundNumber_ + 1) % WorldAmbientSound::soundList_.size();

Modified: code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponPack.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponPack.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/weaponsystem/WeaponPack.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -152,7 +152,7 @@
 
     void WeaponPack::notifyWeapons()
     {
-        for (std::vector<Weapon *>::const_iterator it = this->weapons_.begin(); it != this->weapons_.end(); ++it)
-            (*it)->setWeaponPack(this);
+        for (Weapon* weapon : this->weapons_)
+            weapon->setWeaponPack(this);
     }
 }

Modified: code/branches/cpp11_v2/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/worldentities/ControllableEntity.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/worldentities/ControllableEntity.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -107,8 +107,8 @@
             if (this->camera_)
                 this->camera_->destroy();
 
-            for (std::list<StrongPtr<CameraPosition>>::const_iterator it = this->cameraPositions_.begin(); it != this->cameraPositions_.end(); ++it)
-                (*it)->destroy();
+            for (CameraPosition* cameraPosition : this->cameraPositions_)
+                cameraPosition->destroy();
 
             if (this->getScene()->getSceneManager())
                 this->getScene()->getSceneManager()->destroySceneNode(this->cameraPositionRootNode_->getName());

Modified: code/branches/cpp11_v2/src/orxonox/worldentities/EffectContainer.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/worldentities/EffectContainer.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/worldentities/EffectContainer.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -102,9 +102,9 @@
             lua_call(this->lua_->getInternalLuaState(), 0, 1);
             bool result = (bool)lua_toboolean(this->lua_->getInternalLuaState(), -1);
             lua_pop(this->lua_->getInternalLuaState(), 1);
-            for (std::vector<WorldEntity*>::const_iterator it = this->effects_.begin(); it != this->effects_.end(); ++it)
+            for (WorldEntity* effect : this->effects_)
             {
-                (*it)->setMainState(result);
+                effect->setMainState(result);
             }
         }
     }

Modified: code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/worldentities/pawns/ModularSpaceShip.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -173,11 +173,11 @@
     */
     void ModularSpaceShip::killShipPartStatic(std::string name)
     {
-        for (std::map<StaticEntity*, ShipPart*>::const_iterator it = ModularSpaceShip::partMap_s->begin(); it != ModularSpaceShip::partMap_s->end(); ++it)
+        for (const auto& mapEntry : *ModularSpaceShip::partMap_s)
         {
-            if (it->second->getName() == name)
+            if (mapEntry.second->getName() == name)
             {
-                it->second->death();
+                mapEntry.second->death();
                 return;
             }
         }
@@ -192,11 +192,11 @@
     */
     void ModularSpaceShip::killShipPart(std::string name)
     {
-        for (std::map<StaticEntity*, ShipPart*>::const_iterator it = ModularSpaceShip::partMap_.begin(); it != ModularSpaceShip::partMap_.end(); ++it)
+        for (const auto& mapEntry : ModularSpaceShip::partMap_)
         {
-            if (it->second->getName() == name)
+            if (mapEntry.second->getName() == name)
             {
-                it->second->death();
+                mapEntry.second->death();
                 return;
             }
         }

Modified: code/branches/cpp11_v2/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/worldentities/pawns/Pawn.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/worldentities/pawns/Pawn.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -573,12 +573,10 @@
     // A function to check if this pawn's controller is the master of any formationcontroller
     bool Pawn::hasSlaves()
     {
-        for (ObjectList<FormationController>::iterator it =
-             ObjectList<FormationController>::begin();
-             it != ObjectList<FormationController>::end(); ++it )
+        for (FormationController* controller : ObjectList<FormationController>())
         {
             // checks if the pawn's controller has a slave
-            if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
+            if (this->hasHumanController() && controller->getMaster() == this->getPlayer()->getController())
                 return true;
         }
         return false;
@@ -586,12 +584,10 @@
 
     // A function that returns a slave of the pawn's controller
     Controller* Pawn::getSlave(){
-        for (ObjectList<FormationController>::iterator it =
-                ObjectList<FormationController>::begin();
-                it != ObjectList<FormationController>::end(); ++it )
+        for (FormationController* controller : ObjectList<FormationController>())
         {
-            if (this->hasHumanController() && it->getMaster() == this->getPlayer()->getController())
-                return it->getController();
+            if (this->hasHumanController() && controller->getMaster() == this->getPlayer()->getController())
+                return controller->getController();
         }
         return nullptr;
     }

Modified: code/branches/cpp11_v2/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc
===================================================================
--- code/branches/cpp11_v2/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/src/orxonox/worldentities/pawns/TeamBaseMatchBase.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -91,8 +91,8 @@
         this->setRadarObjectColour(colour);
 
         // Call this so bots stop shooting at the base after they converted it
-        for (ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it != ObjectList<ArtificialController>::end(); ++it)
-            it->abandonTarget(this);
+        for (ArtificialController* controller : ObjectList<ArtificialController>())
+            controller->abandonTarget(this);
     }
 }
 

Modified: code/branches/cpp11_v2/test/util/MathTest.cc
===================================================================
--- code/branches/cpp11_v2/test/util/MathTest.cc	2015-12-05 18:10:56 UTC (rev 10918)
+++ code/branches/cpp11_v2/test/util/MathTest.cc	2015-12-05 21:47:51 UTC (rev 10919)
@@ -244,10 +244,10 @@
         EXPECT_GE(iterations, numbers.size());
 
         // all numbers must satisfy 0 <= <number> < 1
-        for (std::set<float>::iterator it = numbers.begin(); it != numbers.end(); ++it)
+        for (float number : numbers)
         {
-            EXPECT_LE(min, *it);
-            EXPECT_GT(max, *it);
+            EXPECT_LE(min, number);
+            EXPECT_GT(max, number);
         }
     }
 
@@ -267,10 +267,10 @@
         EXPECT_GE(iterations, numbers.size());
 
         // all numbers must satisfy 0 <= <number> < <max>
-        for (std::set<float>::iterator it = numbers.begin(); it != numbers.end(); ++it)
+        for (float number : numbers)
         {
-            EXPECT_LE(min, *it);
-            EXPECT_GT(max, *it);
+            EXPECT_LE(min, number);
+            EXPECT_GT(max, number);
         }
     }
 
@@ -290,10 +290,10 @@
         EXPECT_GE(iterations, numbers.size());
 
         // all numbers must satisfy <min> <= <number> < <max>
-        for (std::set<float>::iterator it = numbers.begin(); it != numbers.end(); ++it)
+        for (float number : numbers)
         {
-            EXPECT_LE(min, *it);
-            EXPECT_GT(max, *it);
+            EXPECT_LE(min, number);
+            EXPECT_GT(max, number);
         }
     }
 
@@ -314,8 +314,8 @@
         EXPECT_GE((size_t)2, numbers.size());
 
         // all numbers must be either 1 oder -1
-        for (std::set<float>::iterator it = numbers.begin(); it != numbers.end(); ++it)
-            EXPECT_TRUE(*it == 1 || *it == -1);
+        for (float number : numbers)
+            EXPECT_TRUE(number == 1 || number == -1);
     }
 
     ///////////////////////




More information about the Orxonox-commit mailing list