]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Enable C++0x/C++11 support
authorvsr <vsr@opencascade.com>
Thu, 15 Oct 2015 14:25:12 +0000 (17:25 +0300)
committervsr <vsr@opencascade.com>
Wed, 28 Oct 2015 15:13:49 +0000 (18:13 +0300)
salome_adm/cmake_files/SalomeSetupPlatform.cmake
src/SALOMEDSImpl/SALOMEDSImpl_StudyManager.cxx

index 1548daeafc20c5b924a6b0f81c2a0171ee73e550..6d8fbf1d2bd6a7357f2ec08ec3f4251b7efa0115 100644 (file)
@@ -165,3 +165,17 @@ IF(NOT WIN32)
     SET(CMAKE_C_FLAGS    "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
   ENDIF()
 ENDIF()
+
+# C++11 support
+INCLUDE(CheckCXXCompilerFlag)
+CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+IF(COMPILER_SUPPORTS_CXX11)
+    MESSAGE(STATUS "Enable C++11 support")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+ELSEIF(COMPILER_SUPPORTS_CXX0X)
+    MESSAGE(STATUS "Enable C++0x support")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+ELSE()
+    MESSAGE(WARNING "Compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
+ENDIF()
index 2bf1f0e7509cbafee64edea3c4b23c0d4abd50fd..cd2ccd04f62a8ba10e3a1cd7d565e549dffc313b 100644 (file)
@@ -1555,9 +1555,9 @@ void ReadNoteBookVariables(SALOMEDSImpl_Study* theStudy, HDFgroup* theGroup)
       SALOMEDSImpl_GenericVariable* aVariable = 
         new SALOMEDSImpl_ScalarVariable(aVarType,std::string(aVarName));
       aVariable->Load(std::string(currentVarValue));
-         aVarsMap.insert(std::make_pair<int,SALOMEDSImpl_GenericVariable*>(order,aVariable));
+      aVarsMap.insert(std::make_pair(order,aVariable));
       delete [] currentVarValue;
-       }
+    }
   }
   
   std::map<int,SALOMEDSImpl_GenericVariable*>::const_iterator it= aVarsMap.begin();