From 59c5d11c607da378118b29024d569638aaee6834 Mon Sep 17 00:00:00 2001
From: Antoine Regimbeau <antoine.regimbeau@c-s.fr>
Date: Mon, 19 Mar 2018 08:26:41 +0100
Subject: [PATCH] REFAC: objectlist derived from boost::noncopyable and const &
 in for loop

---
 .../Core/ObjectList/include/otbObjectListInterface.h   | 10 +++++-----
 .../ApplicationEngine/src/otbWrapperApplication.cxx    |  5 +----
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/Modules/Core/ObjectList/include/otbObjectListInterface.h b/Modules/Core/ObjectList/include/otbObjectListInterface.h
index 8b920a40ef..bec8e87838 100644
--- a/Modules/Core/ObjectList/include/otbObjectListInterface.h
+++ b/Modules/Core/ObjectList/include/otbObjectListInterface.h
@@ -22,11 +22,12 @@
 #define otbObjectListInterface_h
 
 #include "itkDataObject.h"
+#include "boost/core/noncopyable.hpp"
 
 namespace otb
 {
 
-class ObjectListInterface
+class ObjectListInterface : public boost::noncopyable
 {
 /** \class ObjectListInterface
  *  \brief This non template class is an interface that wrapp ObjectList
@@ -37,10 +38,6 @@ class ObjectListInterface
  * \ingroup ObjectListInterface
  */
 public:
-
-  ObjectListInterface() {};
-  virtual ~ObjectListInterface(){};
-
   /**
   Get the nth element of the list as a DataObject *.
   */
@@ -48,6 +45,9 @@ public:
 
   virtual std::size_t Size(void) const = 0;
 
+protected:
+  ObjectListInterface() = default ;
+  virtual ~ObjectListInterface() = default ;
 };
 
 } // end of otb namespace
diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
index 8cb9b8eee2..144b22429e 100644
--- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
+++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx
@@ -511,11 +511,8 @@ void Application::FreeRessources()
   std::set< itk::DataObject * > dataSet;
   std::vector<std::string> paramList = GetParametersKeys(true);
   // Get the end of the pipeline
-  for (std::vector<std::string>::const_iterator it = paramList.begin();
-           it != paramList.end();
-           ++it)
+  for ( const auto & key : paramList )
     {
-    std::string key = *it;
     if ( GetParameterType(key) == ParameterType_OutputImage )
       {
       Parameter* param = GetParameterByKey(key);
-- 
GitLab