changeset 845:cdba0dbb4682

removed some c++11 for older compilers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Jun 2019 14:46:16 +0200
parents 84cd55245e2d
children df6c52402484
files Applications/Generic/GuiAdapter.cpp Applications/Generic/GuiAdapter.h
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Generic/GuiAdapter.cpp	Fri Jun 14 12:16:38 2019 +0200
+++ b/Applications/Generic/GuiAdapter.cpp	Fri Jun 14 14:46:16 2019 +0200
@@ -479,19 +479,19 @@
 
   void GuiAdapter::OnAnimationFrame()
   {
-    for (const auto& handler : animationFrameHandlers_)
+    for (size_t i = 0; i < animationFrameHandlers_.size(); i++)
     {
       // TODO: fix time 
-      (*(handler.first))(0,handler.second);
+      (*(animationFrameHandlers_[i].first))(0, animationFrameHandlers_[i].second);
     }
   }
 
   void GuiAdapter::OnResize()
   {
-    for (const auto& handler : resizeHandlers_)
+    for (size_t i = 0; i < resizeHandlers_.size(); i++)
     {
       // TODO: fix time 
-      (*(handler.first))(0, handler.second);
+      (*(resizeHandlers_[i].first))(0, resizeHandlers_[i].second);
     }
   }
    
--- a/Applications/Generic/GuiAdapter.h	Fri Jun 14 12:16:38 2019 +0200
+++ b/Applications/Generic/GuiAdapter.h	Fri Jun 14 14:46:16 2019 +0200
@@ -45,6 +45,7 @@
 # include "../../Framework/Messages/LockingEmitter.h"
 #endif
 
+#include <vector>
 #include <boost/shared_ptr.hpp>
 #include <boost/weak_ptr.hpp>
 
@@ -309,13 +310,13 @@
     */
     void ViewportsUpdateSize();
 
-    std::vector<boost::weak_ptr<IGuiAdapterWidget>> widgets_;
+    std::vector<boost::weak_ptr<IGuiAdapterWidget> > widgets_;
 
     template<typename F> void VisitWidgets(F func)
     {
-      for (auto w : widgets_)
+      for (size_t i = 0; i < widgets_.size(); i++)
       {
-        boost::shared_ptr<IGuiAdapterWidget> widget = w.lock();
+        boost::shared_ptr<IGuiAdapterWidget> widget = widgets_[i].lock();
         func(widget);
       }
     }