Require C++11
authorRoland Schulz <roland@utk.edu>
Wed, 9 Sep 2015 15:52:02 +0000 (11:52 -0400)
committerErik Lindahl <erik.lindahl@gmail.com>
Wed, 30 Sep 2015 19:45:19 +0000 (21:45 +0200)
Remove gmx_unique_ptr and use std::unique_ptr directly.

Change-Id: I8b1b328b492a629ec8b0b26d49faf851a577743a

50 files changed:
CMakeLists.txt
cmake/gmxGCC44O3BugWorkaround.cmake [deleted file]
cmake/gmxGetGmockTupleWorkaround.cmake [deleted file]
cmake/gmxManageOpenMP.cmake
cmake/gmxTestCXX11.cmake
cmake/gmxTestCompilerProblems.cmake
docs/CMakeLists.txt
docs/dev-manual/build-system.rst
docs/dev-manual/language-features.rst [new file with mode: 0644]
docs/dev-manual/style.rst
docs/install-guide/index.rst
src/config.h.cmakein
src/external/gmock-1.7.0/CMakeLists.txt
src/gromacs/CMakeLists.txt
src/gromacs/analysisdata/abstractdata.cpp
src/gromacs/analysisdata/analysisdata.cpp
src/gromacs/analysisdata/datastorage.cpp
src/gromacs/commandline/cmdlinehelpmodule.cpp
src/gromacs/commandline/cmdlinemodulemanager-impl.h
src/gromacs/commandline/cmdlinemodulemanager.cpp
src/gromacs/commandline/cmdlinemodulemanager.h
src/gromacs/commandline/cmdlineoptionsmodule.cpp
src/gromacs/correlationfunctions/tests/autocorr.cpp
src/gromacs/gmxlib/copyrite.cpp
src/gromacs/listed-forces/listed-forces.cpp
src/gromacs/mdlib/clincs.cpp
src/gromacs/onlinehelp/helptopic.cpp
src/gromacs/onlinehelp/helptopic.h
src/gromacs/onlinehelp/ihelptopic.h
src/gromacs/onlinehelp/tests/helpmanager.cpp
src/gromacs/options/options-impl.h
src/gromacs/options/options.cpp
src/gromacs/pbcutil/pbc-simd.h
src/gromacs/selection/parser.cpp
src/gromacs/selection/parser.h
src/gromacs/selection/parser.y
src/gromacs/selection/parser_internal.h
src/gromacs/selection/parsetree.cpp
src/gromacs/selection/parsetree.h
src/gromacs/selection/selectioncollection-impl.h
src/gromacs/selection/selhelp.cpp
src/gromacs/selection/symrec.cpp
src/gromacs/selection/tests/poscalc.cpp
src/gromacs/trajectoryanalysis/cmdlinerunner.cpp
src/gromacs/utility.h
src/gromacs/utility/scoped_cptr.h
src/gromacs/utility/uniqueptr.h [deleted file]
src/programs/legacymodules.cpp
src/programs/mdrun/tests/multisimtest.h
src/testutils/refdata-impl.h

index 00569ceb1ffe231c73682b1093742cc24460ef63..31de403c44dc32e21f4dd8b71a4307c403daf0f8 100644 (file)
@@ -522,14 +522,22 @@ if(NOT DEFINED GMX_EXTERNAL_BOOST OR GMX_EXTERNAL_BOOST)
     find_package(Boost 1.44.0)
     if(Boost_FOUND AND Boost_VERSION VERSION_LESS "104400")
         set(Boost_FOUND FALSE)
+        set(Boost_Reason "Boost >= 1.44 not found.")
+    endif()
+    # clang with some older versions of boost fail to work with C++11
+    if(CMAKE_CXX_COMPILER_ID MATCHES Clang AND
+        (Boost_VERSION VERSION_EQUAL 104601 OR Boost_VERSION VERSION_EQUAL 104700))
+        set(Boost_FOUND FALSE)
+        set(Boost_Reason "Boost 1.46.1 and 1.47.0 do not work with Clang.")
     endif()
     # Print the notification only on first run, when determining the default
     if(NOT DEFINED GMX_EXTERNAL_BOOST AND NOT Boost_FOUND)
-        message("Boost >= 1.44 not found. Using minimal internal version. "
+        message("${Boost_Reason} Using minimal internal version. "
                 "This may cause trouble if you plan on compiling/linking other "
                 "software that uses Boost against GROMACS.")
     endif()
 endif()
+
 option(GMX_EXTERNAL_BOOST "Use external Boost instead of minimal built-in version"
        ${Boost_FOUND})
 if(GMX_EXTERNAL_BOOST AND NOT Boost_FOUND)
@@ -607,21 +615,10 @@ gmx_test__finite(HAVE__FINITE)
 
 include(gmxTestCXX11)
 gmx_test_cxx11(GMX_CXX11_SUPPORTED GMX_CXX11_FLAGS)
-include(CMakeDependentOption)
-# clang with some older versions of boost fail to work with C++11
-if(CMAKE_CXX_COMPILER_ID MATCHES Clang AND
-    (Boost_VERSION VERSION_EQUAL 104601 OR Boost_VERSION VERSION_EQUAL 104700))
-    set(CLANG_AND_OLD_EXTERNAL_BOOST TRUE)
-endif()
-# nvcc does not support C++11 flags, so with GPUs we prefer to skip C++11 flags
-# entirely to keep the compilation environment uniform.
-cmake_dependent_option(GMX_CXX11
-    "Use C++11 features"
-    ON "GMX_CXX11_SUPPORTED AND NOT GMX_GPU AND NOT CLANG_AND_OLD_EXTERNAL_BOOST" OFF)
-mark_as_advanced(GMX_CXX11)
-if(GMX_CXX11)
-    set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} ${GMX_CXX11_FLAGS}")
+if(NOT GMX_CXX11_SUPPORTED)
+    message(FATAL_ERROR "This version of GROMACS requires C++11. Please use a newer compiler or use the GROMACS 5.1.x release. Note it might be sufficient to instruct the compiler to use a newer STL version. See the installation guide for details.")
 endif()
+set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} ${GMX_CXX11_FLAGS}")
 
 # Now we can test for CXX11_REGEX include file
 check_include_file_cxx(regex     HAVE_CXX11_REGEX)
diff --git a/cmake/gmxGCC44O3BugWorkaround.cmake b/cmake/gmxGCC44O3BugWorkaround.cmake
deleted file mode 100644 (file)
index a71d88f..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
-# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
-# and including many others, as listed in the AUTHORS file in the
-# top-level source directory and at http://www.gromacs.org.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-
-# Due to a bug, gcc 4.4.x crashes when compiling listed-forces/bonded.cpp with -O3 and
-# -fopenmp, but strangely it does not crash with -O2 + all additional options.
-# -O3 uses. Therefore, for the affected files, when compiling in release mode,
-# we override -O3 with -O2 and add the additional option.
-#
-
-# Considering compiler version and build configuration, check if the workaround
-# is needed to avoid gcc crash.
-macro(gmx_check_gcc44_bug_workaround_needed OUT_VAR)
-    if(CMAKE_COMPILER_IS_GNUCC AND
-    CMAKE_C_COMPILER_VERSION VERSION_GREATER "4.3.999" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "4.4.999")
-
-        set(_gcc44_workaround FALSE)
-
-        # only apply the workaround if we are actually using -O3
-        string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type)
-        if ("${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${_build_type}}" MATCHES ".*-O3.*" AND
-            GMX_OPENMP)
-            if(GMX_DISABLE_GCC44_BUG_WORKAROUND)
-                set(_msg "gcc ${CMAKE_C_COMPILER_VERSION} detected, using -O3, but workaround for optimization bug is disabled")
-            else()
-                set(_msg "gcc ${CMAKE_C_COMPILER_VERSION} detected, using -O3, will apply workaround for optimization bug (disable with GMX_DISABLE_GCC44_BUG_WORKAROUND)")
-                set(_gcc44_workaround TRUE)
-            endif()
-            # only issues message if the value has changed
-            if((NOT _gcc44_workaround AND ${OUT_VAR}) OR (_gcc44_workaround AND NOT ${OUT_VAR}))
-                message(STATUS "${_msg}")
-            endif()
-        endif()
-
-        set(${OUT_VAR} ${_gcc44_workaround} CACHE INTERNAL "Use gcc 4.4.x O3 optimization bug workaround" FORCE)
-    endif()
-endmacro()
-
-# Apply workaround on the specified source file.
-#
-# This workaround does not seem to affect the performance in a measurable way.
-macro(gmx_apply_gcc44_bug_workaround FILE_NAME)
-    set_source_files_properties(
-        ${FILE_NAME}
-        PROPERTIES
-        COMPILE_FLAGS "-O2 -finline-functions -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -fipa-cp-clone"
-        )
-endmacro()
diff --git a/cmake/gmxGetGmockTupleWorkaround.cmake b/cmake/gmxGetGmockTupleWorkaround.cmake
deleted file mode 100644 (file)
index d9456bb..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2014, by the GROMACS development team, led by
-# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
-# and including many others, as listed in the AUTHORS file in the
-# top-level source directory and at http://www.gromacs.org.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-
-# GMock uses tuples extensively, but since it is part of tr1 we cannot
-# assume it is present - the Fujitsu compilers on K computer is one
-# example of a system where it is not, and this is likely the case for many
-# embedded systems too.
-#
-# In general, we can ask gmock to use its own internal implementation by
-# defining GTEST_USE_OWN_TR1_TUPLE=1. This is safe for Gromacs, since we do
-# not use tr1/tuple.h elsewhere. However, this workaround itself will not
-# compile on MSVC - but this is the only architecture we know where it does
-# not work. To make things even worse, on MSVC even the standard tr1/tuple
-# implementation is not fully compatible, but we can make it work by setting
-# _VARIADIC_MAX=10. This is similar to r675 of googletest, which is still not
-# present in GMock 1.7.0. See
-# https://code.google.com/p/googletest/source/detail?r=675#, but note
-# that its summary does not represent its code correctly.
-#
-# To make all this work without user intervention, we first check what compiler
-# we have, and if it is not MSVC we simply use the internal version. If we are
-# using MSVC, we rely on the compiler's version, but set the variable necessary
-# to make it compatible.
-#
-# This function should be called to get the compile definitions
-# suitable for making sure we have a tuple implementation that works with gmock.
-#
-# Returns a string of options in VARIABLE
-function(GET_GMOCK_TUPLE_WORKAROUND VARIABLE)
-    set(${VARIABLE} "")
-    if(MSVC OR (WIN32 AND CMAKE_CXX_COMPILER_ID MATCHES "Intel"))
-        if(MSVC_VERSION VERSION_EQUAL 1700)
-            # Fixes Visual Studio 2012
-            set(${VARIABLE} "_VARIADIC_MAX=10")
-        endif()
-        # For MSVC different from 2012, or Intel on Windows, we reply on tr1/tuple working.
-    else()
-        # Use the built-in version on all other compilers.
-        set(${VARIABLE} "GTEST_USE_OWN_TR1_TUPLE=1")
-    endif()
-    set(${VARIABLE} ${${VARIABLE}} PARENT_SCOPE)
-endfunction()
index ddcf7c4c9f42599037daf028cda8739aab4ed0aa..5903957beff2a67a1d01d03e107a79e8bf0b202d 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
 # versions before trying to detect OpenMP with the standard find-package-module,
 # and then does some additional tests for flags afterwards.
 
-# First exclude compilers known to not work with OpenMP although claim to support it:
-# gcc 4.2.1 and gcc-llvm 4.2.1 (also claims to be 4.2.1) on Mac OS X
-# This fixes redmine 900 and needs to run before OpenMP flags are set below.
 if(GMX_OPENMP)
-    if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND
-        (CMAKE_COMPILER_IS_GNUCC AND CMAKE_C_COMPILER_VERSION AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.3))
-        message(STATUS "OpenMP multithreading not supported with gcc/llvm-gcc 4.2 on Mac OS X, disabled")
-        set(GMX_OPENMP OFF CACHE BOOL
-            "OpenMP multithreading not not supported with gcc/llvm-gcc 4.2 on Mac OS X, disabled!" FORCE)
-    elseif(CMAKE_C_COMPILER_ID MATCHES "Cray" AND CMAKE_VERSION VERSION_LESS 3)
+    if(CMAKE_C_COMPILER_ID MATCHES "Cray" AND CMAKE_VERSION VERSION_LESS 3)
         message(STATUS "OpenMP multithreading is not detected correctly for the Cray compiler with CMake before version 3.0 (see http://public.kitware.com/Bug/view.php?id=14567)")
         set(GMX_OPENMP OFF CACHE BOOL
             "OpenMP multithreading is not detected correctly for the Cray compiler with CMake before version 3.0 (see http://public.kitware.com/Bug/view.php?id=14567)" FORCE)
index 9dc57647be99f4884f6a5253fe3748990fd142f7..6aa070eba9039a44b062dbbbdc2a106f48646cc3 100644 (file)
@@ -47,27 +47,15 @@ MACRO(GMX_TEST_CXX11 VARIABLE FLAG)
     endif()
     set(CMAKE_REQUIRED_FLAGS "${CXX11_FLAG}")
     check_cxx_source_compiles(
-"#include <vector>
+"#include <map>
 #include <memory>
 #include <utility>
-struct A {
-  A(int *i=NULL) : p(i) {} ;
-  std::unique_ptr<int> p;
-};
-template <typename Head, typename... Tail>
-struct VarList {
-  typedef VarList<Tail...> VarListTail;
-  typedef std::pair<Head, typename VarListTail::ListType> ListType;
-};
 class a { explicit operator bool() {return true;} };
 int main() {
   typedef std::unique_ptr<int> intPointer;
   intPointer p(new int(10));
-  std::vector<intPointer> v;
-  v.push_back(std::move(p));
-  std::vector<A> v2;
-  v2.push_back(A());  //requires default move constructor
-  v2.push_back(A(new int(5))); //detects bug in ICC
+  std::map<int, std::unique_ptr<int>> m;
+  m.insert(std::make_pair(5, std::move(p)));
 }" ${VARIABLE})
     set(CMAKE_REQUIRED_FLAGS "")
     if(${VARIABLE})
index 48580c3c77efc239344d4091771554cfc6ded1a9..9f7d6fb0125731da20862d50ca9702ccdff1477f 100644 (file)
@@ -44,13 +44,6 @@ macro(gmx_test_compiler_problems)
         message(WARNING "The versions of the C and C++ compilers do not match (${CMAKE_C_COMPILER_VERSION} and ${CMAKE_CXX_COMPILER_VERSION}, respectively). Mixing different C/C++ compilers can cause problems.")
     endif()
 
-    # gcc 4.4.x is buggy and crashes when compiling some files with O3 and OpenMP on.
-    # Detect here whether applying a workaround is needed and will apply it later
-    # on the affected files. This test must come after gmx_c_flags(), since we
-    # only want to enable the workaround when using the -O3 flag.
-    include(gmxGCC44O3BugWorkaround)
-    gmx_check_gcc44_bug_workaround_needed(GMX_USE_GCC44_BUG_WORKAROUND)
-
     # clang 3.0 is buggy for some unknown reason detected during adding
     # the SSE2 group kernels for GROMACS 4.6. If we ever work out what
     # that is, we should replace these tests with a compiler feature test,
@@ -96,8 +89,4 @@ macro(gmx_test_compiler_problems)
         endif()
     endif()
 
-    if(CMAKE_C_COMPILER_ID MATCHES "Intel" AND CMAKE_C_COMPILER_VERSION VERSION_LESS "12.0.0")
-        message(WARNING "Intel compilers before 12.0.0 are not routinely tested, so there may be problems. Version 11.1 with SSE4.1 is known to produce incorrect results. It is highly recommended to use a more up-to-date compiler. If you choose to use this version, make sure you run the regressiontests.")
-    endif()
-
 endmacro(gmx_test_compiler_problems)
index 8098a00da77c80bf0bbc7a7f8f17ad12ded8c083..b4ac8d8d5e0dcdf5588b8fd30232455dc7f6ae37 100644 (file)
@@ -105,6 +105,7 @@ if (SPHINX_FOUND)
         dev-manual/gmxtree.rst
         dev-manual/includestyle.rst
         dev-manual/jenkins.rst
+        dev-manual/language-features.rst
         dev-manual/naming.rst
         dev-manual/overview.rst
         dev-manual/relocatable-binaries.rst
index 13a66cb00863088181cfa35399d13de280c1f744..ff63e48b83eade4a2d6748e7eec05cc2f0afc3a2 100644 (file)
@@ -190,16 +190,6 @@ Variables affecting compilation/linking
 
 .. cmake:: GMX_BUILD_SHARED_EXE
 
-.. cmake:: GMX_CXX11
-
-   If ``ON``, some C++11 features are used internally (mainly
-   ``std::unique_ptr``).
-   If ``OFF``, no C++11 features are used in the code (``boost::shared_ptr`` is
-   used as a replacement).
-   The default is ``ON`` if the compilation environment is determined to
-   support enough C++11 (GPU builds cannot for now use C++11).
-   Installed headers are not affected.
-
 .. cmake:: GMX_CYCLE_SUBCOUNTERS
 
 .. cmake:: GMX_DATA_INSTALL_DIR
diff --git a/docs/dev-manual/language-features.rst b/docs/dev-manual/language-features.rst
new file mode 100644 (file)
index 0000000..ceb0e34
--- /dev/null
@@ -0,0 +1,17 @@
+Allowed language features
+=========================
+
+GROMACS uses C99 for C files and C++11 for C++ files. 
+C++ has a lot of features, but to keep the source code maintainable and easy to read, 
+we will avoid using some of them in Gromacs code. The basic principle is to keep things 
+as simple as possible.
+For compatiblity certain work-arounds are required because not all compilers support 
+these standards fully.
+
+* MSVC supports only a subset of C99 and work-arounds are required in those cases.
+* Before 7.0 (partial support in 6.5) CUDA didn't support C++11. Therefore any
+  header file which is needed (or likly will be nedded) by CUDA should not use C++11.
+* C++11 features which are not widely implemented (including in MSVC 2013 and GCC 4.6)
+  should not be used.
+
+.. TODO: Copy important points from http://www.gromacs.org/index.php?title=Developer_Zone/Programming_Guide/Allowed_C%2B%2B_Features
index a4356f4e164864c5b448ff69ddb97a048a0d3953..7536c8179aa18a5a58744dbe39a38bb6f5b2a985 100644 (file)
@@ -7,6 +7,7 @@ Style guidelines
    formatting
    includestyle
    naming
+   language-features
 
 :doc:`formatting`
   Guidelines for indentation and other code formatting.
@@ -14,6 +15,8 @@ Style guidelines
   Guidelines for #include style (ordering, paths to use, etc.).
 :doc:`naming`
   Naming conventions for files and various code constructs.
+:doc:`language-features`
+  Allowed language features.
 :ref:`dev-doxygen-guidelines`
   Guidelines for using Doxygen to document the source code are currently in a
   section on the page on general Doxygen usage.
index 37aa08c1b4099ed77d0b769c77e38fc6b29210c6..0f182629196db352af45ef9e7f767a570f0e2c0c 100644 (file)
@@ -85,14 +85,30 @@ architectures including x86, AMD64/x86-64, PPC, ARM v7 and SPARC VIII.
 Compiler
 --------
 Technically, |Gromacs| can be compiled on any platform with an ANSI C99
-and C++98 compiler, and their respective standard C/C++ libraries.
-We use only a few C99 features, but note that the C++ compiler also needs to
-support these C99 features (notably, int64_t and related things), which are not
-part of the C++98 standard.
+and C++11 compiler, and their respective standard C/C++ libraries.
+GROMACS uses a subset of C99 and C++11. A not fully standard compliant
+compiler might be able to compile GROMACS.
 Getting good performance on an OS and architecture requires choosing a
 good compiler. In practice, many compilers struggle to do a good job
 optimizing the |Gromacs| architecture-optimized SIMD kernels.
 
+C++11 support requires both support in the compiler as well as in the
+C++ library. Multiple compilers do not provide their own library
+but use the system library. It is required to select a library with
+sufficient C++11 support. Both the Intel and clang compiler on Linux use
+the libstdc++ which comes with gcc as the default C++ library. 4.6.1 of
+that library is required. Also the C++ library version has to be
+supported by the compiler. To select the C++ library version use:
+
+* For Intel: ``CXXFLAGS=-gcc-name=/path/to/gcc/binary`` or make sure
+  that the correct gcc version is first in path (e.g. by loading the gcc
+  module)
+* For clang: ``CFLAGS=--gcc-toolchain=/path/to/gcc/folder
+  CXXFLAGS=--gcc-toolchain=/path/to/gcc/folder``. This folder should
+  contain ``include/c++``.
+* On Windows with e.g. Intel: at least MSVC 2013 is required. Load the
+  enviroment with vcvarsall.bat.
+
 For best performance, the |Gromacs| team strongly recommends you get the
 most recent version of your preferred compiler for your platform.
 There is a large amount of |Gromacs| code that depends on effective
@@ -1142,8 +1158,8 @@ much everywhere, it is important that we tell you where we really know
 it works because we have tested it. We do test on Linux, Windows, and
 Mac with a range of compilers and libraries for a range of our
 configuration options. Every commit in our git source code repository
-is currently tested on x86 with gcc versions ranging from 4.1 through
-5.1, and versions 12 through 15 of the Intel compiler as well as Clang
+is currently tested on x86 with gcc versions ranging from 4.6 through
+5.1, and versions 14 and 15 of the Intel compiler as well as Clang
 version 3.4 through 3.6. For this, we use a variety of GNU/Linux
 flavors and versions as well as recent versions of Mac OS X and Windows.  Under
 Windows we test both MSVC and the Intel compiler. For details, you can
index e89e5e30cf5e43beae65a8743d59188599936e50..e09647aedba441edda7df5cf636c703cf9caadb3 100644 (file)
@@ -73,9 +73,6 @@
 /** Define if we are building for Cygwin */
 #cmakedefine GMX_CYGWIN
 
-/** Define if we have sufficient C++11 support */
-#cmakedefine01 GMX_CXX11
-
 /* GCC bug in AVX maskload/maskstore arguments - worked around internally */
 #cmakedefine GMX_SIMD_X86_AVX_GCC_MASKLOAD_BUG
 
index a60eb707fee7ade2583a6abaab755582f75395bc..e4d01477e25774c7be05cb5fb77d5f3681629f30 100644 (file)
@@ -59,9 +59,6 @@ if(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5")
     endif()
 endif()
 
-include(gmxGetGmockTupleWorkaround)
-get_gmock_tuple_workaround(GMOCK_COMPILE_DEFINITIONS)
-
 # GTest/GMock suggest linking with pthreads when available for thread safety
 set(CMAKE_THREAD_PREFER_PTHREAD 1)
 find_package(Threads)
@@ -70,6 +67,12 @@ if (CMAKE_USE_PTHREADS_INIT)
     set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
 endif()
 
+# Skip variadic implementation of matchers if using GCC < 4.7 due to
+# GCC Bug 35722 -[C++0x] Variadic templates expansion into non-variadic class template
+if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7")
+    list(APPEND GMOCK_COMPILE_DEFINITIONS "GTEST_LANG_CXX11=0")
+endif()
+
 set(GMOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 set(GTEST_DIR ${GMOCK_DIR}/gtest)
 set(GTEST_SOURCES ${GTEST_DIR}/src/gtest-all.cc)
index cdfef02dea2158c83804cb064c512f904a10491e..ab9188327c0163f8faf89d509015ea490992cb98 100644 (file)
@@ -159,14 +159,6 @@ gmx_configure_version_file(
     REMOTE_HASH SOURCE_FILE)
 list(APPEND LIBGROMACS_SOURCES ${GENERATED_VERSION_FILE})
 
-# apply gcc 4.4.x bug workaround
-if(GMX_USE_GCC44_BUG_WORKAROUND)
-   include(gmxGCC44O3BugWorkaround)
-   gmx_apply_gcc44_bug_workaround("listed-forces/bonded.cpp")
-   gmx_apply_gcc44_bug_workaround("mdlib/force.c")
-   gmx_apply_gcc44_bug_workaround("mdlib/constr.c")
-endif()
-
 if (GMX_GPU AND NOT GMX_USE_OPENCL)
     cuda_add_library(libgromacs ${LIBGROMACS_SOURCES})
 else()
index 94e210389318863e60805ada6aed2487fd0d2e78..0410d3ff62f010c7511d3f582ed141dfc5ff417d 100644 (file)
@@ -50,7 +50,6 @@
 #include "gromacs/analysisdata/datamodulemanager.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/uniqueptr.h"
 
 #include "dataproxy.h"
 
index 3d528be711d4c8c933cfc4923fc6385fab68c067..2b0e0c1b56fd6986ee7818887acf9c16e09e3c6d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include "analysisdata.h"
 
+#include <memory>
+
 #include "gromacs/analysisdata/dataframe.h"
 #include "gromacs/analysisdata/datastorage.h"
 #include "gromacs/analysisdata/paralleloptions.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/uniqueptr.h"
 
 namespace gmx
 {
@@ -95,7 +96,7 @@ class AnalysisData::Impl
 {
     public:
         //! Smart pointer type to manage a data handle implementation.
-        typedef gmx_unique_ptr<internal::AnalysisDataHandleImpl>::type
+        typedef std::unique_ptr<internal::AnalysisDataHandleImpl>
             HandlePointer;
         //! Shorthand for a list of data handles.
         typedef std::vector<HandlePointer> HandleList;
@@ -171,7 +172,7 @@ AnalysisData::startData(const AnalysisDataParallelOptions &opt)
     }
 
     Impl::HandlePointer handle(new internal::AnalysisDataHandleImpl(this));
-    impl_->handles_.push_back(move(handle));
+    impl_->handles_.push_back(std::move(handle));
     return AnalysisDataHandle(impl_->handles_.back().get());
 }
 
index 383a271e08c9c194938543825d87941256b65906..d942edb0577994b7166679f28eaaed77d6b91a25 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -46,6 +46,7 @@
 #include <algorithm>
 #include <iterator>
 #include <limits>
+#include <memory>
 #include <vector>
 
 #include "gromacs/analysisdata/abstractdata.h"
@@ -54,7 +55,6 @@
 #include "gromacs/analysisdata/paralleloptions.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/uniqueptr.h"
 
 namespace gmx
 {
@@ -85,7 +85,7 @@ namespace internal
 {
 
 //! Smart pointer type for managing a storage frame builder.
-typedef gmx_unique_ptr<AnalysisDataStorageFrame>::type
+typedef std::unique_ptr<AnalysisDataStorageFrame>
     AnalysisDataFrameBuilderPointer;
 
 /*! \internal \brief
@@ -97,7 +97,7 @@ class AnalysisDataStorageImpl
 {
     public:
         //! Smart pointer type for managing a stored frame.
-        typedef gmx_unique_ptr<AnalysisDataStorageFrameData>::type FramePointer;
+        typedef std::unique_ptr<AnalysisDataStorageFrameData> FramePointer;
 
         //! Shorthand for a list of data frames that are currently stored.
         typedef std::vector<FramePointer> FrameList;
@@ -488,9 +488,9 @@ AnalysisDataStorageImpl::getFrameBuilder()
     {
         return AnalysisDataFrameBuilderPointer(new AnalysisDataStorageFrame(*data_));
     }
-    AnalysisDataFrameBuilderPointer builder(move(builders_.back()));
+    AnalysisDataFrameBuilderPointer builder(std::move(builders_.back()));
     builders_.pop_back();
-    return move(builder);
+    return std::move(builder);
 }
 
 
@@ -603,7 +603,7 @@ AnalysisDataStorageFrameData::startFrame(
 {
     status_         = eStarted;
     header_         = header;
-    builder_        = move(builder);
+    builder_        = std::move(builder);
     builder_->data_ = this;
     builder_->selectDataSet(0);
 }
@@ -653,9 +653,9 @@ AnalysisDataStorageFrameData::finishFrame(bool bMultipoint)
         GMX_RELEASE_ASSERT(!builder_->bPointSetInProgress_,
                            "Unfinished point set");
     }
-    AnalysisDataFrameBuilderPointer builder(move(builder_));
+    AnalysisDataFrameBuilderPointer builder(std::move(builder_));
     builder_.reset();
-    return move(builder);
+    return std::move(builder);
 }
 
 
index cabe8f1b7a4507c06d13d032352f1f4d2ae654ec..32465672548edf28e20657906077d3463b48fdc6 100644 (file)
@@ -238,7 +238,7 @@ class RootHelpTopic : public AbstractCompositeHelpTopic
             {
                 exportedTopics_.push_back(topic->name());
             }
-            addSubTopic(move(topic));
+            addSubTopic(std::move(topic));
         }
         //! Exports all the top-level topics with the given exporter.
         void exportHelp(IHelpExport *exporter);
@@ -885,7 +885,7 @@ HelpTopicPointer CommandLineHelpModule::createModuleHelpTopic(
 
 void CommandLineHelpModule::addTopic(HelpTopicPointer topic, bool bExported)
 {
-    impl_->rootTopic_->addTopic(move(topic), bExported);
+    impl_->rootTopic_->addTopic(std::move(topic), bExported);
 }
 
 void CommandLineHelpModule::setShowHidden(bool bHidden)
index c7ee78023be336d2dab587a0981f10c8f9b82e2c..9238674e26bc4d03b9b22f8fab8ae364d080b325 100644 (file)
@@ -43,6 +43,7 @@
 #define GMX_COMMANDLINE_CMDLINEMODULEMANAGER_IMPL_H
 
 #include <map>
+#include <memory>
 #include <string>
 #include <vector>
 
@@ -52,7 +53,6 @@
 #include "gromacs/options/options.h"
 #include "gromacs/utility/classhelpers.h"
 #include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/uniqueptr.h"
 
 namespace gmx
 {
@@ -127,7 +127,7 @@ class CommandLineModuleGroupData
 };
 
 //! Smart pointer type for managing a CommandLineModuleGroup.
-typedef gmx_unique_ptr<CommandLineModuleGroupData>::type
+typedef std::unique_ptr<CommandLineModuleGroupData>
     CommandLineModuleGroupDataPointer;
 //! Container type for keeping a list of module groups.
 typedef std::vector<CommandLineModuleGroupDataPointer>
index 83f35de08bb2b031c9ad2936cc81a686cf635a5d..de95b72264e4f93a773d20a52b8ed62e28705899 100644 (file)
@@ -319,8 +319,8 @@ void CommandLineModuleManager::Impl::addModule(CommandLineModulePointer module)
     ensureHelpModuleExists();
     HelpTopicPointer helpTopic(helpModule_->createModuleHelpTopic(*module));
     modules_.insert(std::make_pair(std::string(module->name()),
-                                   move(module)));
-    helpModule_->addTopic(move(helpTopic), false);
+                                   std::move(module)));
+    helpModule_->addTopic(std::move(helpTopic), false);
 }
 
 void CommandLineModuleManager::Impl::ensureHelpModuleExists()
@@ -451,7 +451,7 @@ void CommandLineModuleManager::setSingleModule(ICommandLineModule *module)
 
 void CommandLineModuleManager::addModule(CommandLineModulePointer module)
 {
-    impl_->addModule(move(module));
+    impl_->addModule(std::move(module));
 }
 
 void CommandLineModuleManager::addModuleCMain(
@@ -460,7 +460,7 @@ void CommandLineModuleManager::addModuleCMain(
 {
     CommandLineModulePointer module(
             new CMainCommandLineModule(name, shortDescription, mainFunction));
-    addModule(move(module));
+    addModule(std::move(module));
 }
 
 CommandLineModuleGroup CommandLineModuleManager::addModuleGroup(
@@ -469,14 +469,14 @@ CommandLineModuleGroup CommandLineModuleManager::addModuleGroup(
     const char *const                 binaryName = impl_->binaryName_.c_str();
     CommandLineModuleGroupDataPointer group(
             new CommandLineModuleGroupData(impl_->modules_, binaryName, title));
-    impl_->moduleGroups_.push_back(move(group));
+    impl_->moduleGroups_.push_back(std::move(group));
     return CommandLineModuleGroup(impl_->moduleGroups_.back().get());
 }
 
 void CommandLineModuleManager::addHelpTopic(HelpTopicPointer topic)
 {
     impl_->ensureHelpModuleExists();
-    impl_->helpModule_->addTopic(move(topic), true);
+    impl_->helpModule_->addTopic(std::move(topic), true);
 }
 
 int CommandLineModuleManager::run(int argc, char *argv[])
index 5271d242f76832b83d255eeedbb8f0097eea1056..57749b3949a8105c64486fe114c0c9b72a8e9f26 100644 (file)
 #ifndef GMX_COMMANDLINE_CMDLINEMODULEMANAGER_H
 #define GMX_COMMANDLINE_CMDLINEMODULEMANAGER_H
 
+#include <memory>
+
 #include "gromacs/onlinehelp/ihelptopic.h"
 #include "gromacs/utility/classhelpers.h"
-#include "gromacs/utility/uniqueptr.h"
 
 namespace gmx
 {
@@ -60,7 +61,7 @@ class IFileOutputRedirector;
 //! \{
 
 //! Smart pointer type for managing a ICommandLineModule.
-typedef gmx_unique_ptr<ICommandLineModule>::type
+typedef std::unique_ptr<ICommandLineModule>
     CommandLineModulePointer;
 
 /*! \libinternal \brief
index 581174ffba00eb5a11f7ab4de73bbe094be03eb9..d4ad9d6964a7715eb781c014a4bae612671c9477 100644 (file)
@@ -208,7 +208,7 @@ void ICommandLineOptionsModule::registerModule(
         const char *description, FactoryMethod factory)
 {
     CommandLineModulePointer module(createModule(name, description, factory));
-    manager->addModule(move(module));
+    manager->addModule(std::move(module));
 }
 
 // static
@@ -218,7 +218,7 @@ void ICommandLineOptionsModule::registerModule(
 {
     CommandLineModulePointer wrapperModule(
             new CommandLineOptionsModule(name, description, module));
-    manager->addModule(move(wrapperModule));
+    manager->addModule(std::move(wrapperModule));
 }
 
 } // namespace gmx
index 560d8a6fb5993aca351c2b46a8f1fa42a7ed43f3..2b2c86dd0697fa1549f02fd6db10296bfc42676e 100644 (file)
 
 #include <cmath>
 
+#include <memory>
+
 #include <gtest/gtest.h>
 
 #include "gromacs/correlationfunctions/expfit.h"
 #include "gromacs/fft/fft.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/uniqueptr.h"
 
 #include "testutils/refdata.h"
 #include "testutils/testasserts.h"
@@ -66,7 +67,7 @@ namespace
 {
 
 //! Definition of pointer to class containing test data.
-typedef gmx_unique_ptr<CorrelationDataSet>::type CorrelationDataSetPointer;
+typedef std::unique_ptr<CorrelationDataSet> CorrelationDataSetPointer;
 
 class AutocorrTest : public ::testing::Test
 {
index b0bf90f9df91a15f32c12044717ea6e16cb6ce4f..2eeae276e5c849e8beb89448a621dcc6c54a7688 100644 (file)
@@ -739,11 +739,6 @@ static void gmx_print_version_info(FILE *fp)
 #else
     fprintf(fp, "RDTSCP usage:       disabled\n");
 #endif
-#if GMX_CXX11
-    fprintf(fp, "C++11 compilation:  enabled\n");
-#else
-    fprintf(fp, "C++11 compilation:  disabled\n");
-#endif
 #ifdef GMX_USE_TNG
     fprintf(fp, "TNG support:        enabled\n");
 #else
index 62328e8d3762932f943650197b7fc4bcd3117887..44cd2368c9cf64694ad5caff1123d639051b1e4e 100644 (file)
@@ -264,13 +264,7 @@ calc_one_bond(int thread,
               int *global_atom_index)
 {
 #ifdef GMX_SIMD_HAVE_REAL
-    gmx_bool bUseSIMD;
-    /* MSVC 2010 produces buggy SIMD PBC code, disable SIMD for MSVC <= 2010 */
-#if defined _MSC_VER && _MSC_VER < 1700 && !defined(__ICL)
-    bUseSIMD = FALSE;
-#else
-    bUseSIMD = fr->use_simd_kernels;
-#endif
+    gmx_bool bUseSIMD = fr->use_simd_kernels;
 #endif
 
     int      nat1, nbonds, efptFTYPE;
index 1e8be66047920e941de8168031d639273d5de188..007c371d4f809396b0b79aa8fe925033cffa87ab 100644 (file)
@@ -67,8 +67,7 @@
 #include "gromacs/utility/gmxomp.h"
 #include "gromacs/utility/smalloc.h"
 
-/* MSVC 2010 produces buggy SIMD PBC code, disable SIMD for MSVC <= 2010 */
-#if defined GMX_SIMD_HAVE_REAL && !(defined _MSC_VER && _MSC_VER < 1700) && !defined(__ICL)
+#if defined GMX_SIMD_HAVE_REAL
 #define LINCS_SIMD
 #endif
 
index c1eafa9dace4ceaf586f8a8787e3bcba2e5f12de..3dace169927ccbe72686b0fb6fa2b3ac610a163c 100644 (file)
@@ -208,7 +208,7 @@ void AbstractCompositeHelpTopic::addSubTopic(HelpTopicPointer topic)
     const IHelpTopic *topicPtr = topic.get();
     impl_->subTopics_.reserve(impl_->subTopics_.size() + 1);
     impl_->subTopicMap_.insert(std::make_pair(std::string(topicPtr->name()), topicPtr));
-    impl_->subTopics_.push_back(move(topic));
+    impl_->subTopics_.push_back(std::move(topic));
 }
 
 } // namespace gmx
index d9027d6a57a561efd412139df36a2ae2addfb052..8d3a46c53a13646031bed26135dd58cd8a202ede 100644 (file)
 #ifndef GMX_ONLINEHELP_HELPTOPIC_H
 #define GMX_ONLINEHELP_HELPTOPIC_H
 
+#include <memory>
+
 #include "gromacs/onlinehelp/ihelptopic.h"
 #include "gromacs/utility/classhelpers.h"
 #include "gromacs/utility/stringutil.h"
-#include "gromacs/utility/uniqueptr.h"
 
 namespace gmx
 {
@@ -184,7 +185,7 @@ class AbstractCompositeHelpTopic : public IHelpTopic
  *
  * \inlibraryapi
  */
-typedef gmx_unique_ptr<AbstractCompositeHelpTopic>::type
+typedef std::unique_ptr<AbstractCompositeHelpTopic>
     CompositeHelpTopicPointer;
 //! \endcond
 
index edb9343d328ae251df40a49db753b7c2863785f4..2c6aa8990b9ba81f1f977e3c1e52f9b42a71cea8 100644 (file)
@@ -43,7 +43,7 @@
 #ifndef GMX_ONLINEHELP_IHELPTOPIC_H
 #define GMX_ONLINEHELP_IHELPTOPIC_H
 
-#include "gromacs/utility/uniqueptr.h"
+#include <memory>
 
 namespace gmx
 {
@@ -106,7 +106,7 @@ class IHelpTopic
 };
 
 //! Smart pointer type to manage a IHelpTopic object.
-typedef gmx_unique_ptr<IHelpTopic>::type HelpTopicPointer;
+typedef std::unique_ptr<IHelpTopic> HelpTopicPointer;
 
 } // namespace gmx
 
index 05dfb2438202bc87f0774dcc69adee9053572f83..67c85390206eb4341bd49c1f6a093b900f1f8dbd 100644 (file)
@@ -168,7 +168,7 @@ TEST_F(HelpTopicFormattingTest, FormatsCompositeTopicWithSubTopics)
     gmx::CompositeHelpTopicPointer topic(new gmx::CompositeHelpTopic<TestHelpText>);
     MockHelpTopic::addSubTopic(topic.get(), "subtopic", "First subtopic", "Text");
     MockHelpTopic::addSubTopic(topic.get(), "other", "Second subtopic", "Text");
-    rootTopic_.addSubTopic(move(topic));
+    rootTopic_.addSubTopic(std::move(topic));
     checkHelpFormatting();
 }
 
index aaf61fb4d822ecfb3b6be2152b04b35f546a3a9a..9051ddd17f9011a63ab0c512bfafd5f022a2a6d7 100644 (file)
 
 #include <list>
 #include <map>
+#include <memory>
 #include <string>
 #include <vector>
 
 #include "gromacs/options/abstractoption.h"
 #include "gromacs/options/optionmanagercontainer.h"
 #include "gromacs/options/options.h"
-#include "gromacs/utility/uniqueptr.h"
 
 namespace gmx
 {
@@ -107,7 +107,7 @@ class OptionsImpl
         };
 
         //! Smart pointer for managing an AbstractOptionStorage object.
-        typedef gmx_unique_ptr<AbstractOptionStorage>::type
+        typedef std::unique_ptr<AbstractOptionStorage>
             AbstractOptionStoragePointer;
         //! Convenience type for list of sections.
         typedef std::vector<Options *> SubSectionList;
index f6a018ad7b2108181259ce819a0762d0a4f535e4..2a6e5f2ba5e0bcacb7cb6e16cddd5adf4031821d 100644 (file)
@@ -146,7 +146,7 @@ OptionInfo *OptionsImpl::Group::addOption(const AbstractOption &settings)
     options_.reserve(options_.size() + 1);
     std::pair<OptionMap::iterator, bool> insertionResult =
         parent_->optionMap_.insert(std::make_pair(option->name(),
-                                                  move(option)));
+                                                  std::move(option)));
     if (!insertionResult.second)
     {
         GMX_THROW(APIError("Duplicate option: " + option->name()));
index b0c247b29e9131d6efa3d831deab8fe4cd507cee..a8f90af4c15d446eee215b8cca4635cc384c81ea 100644 (file)
@@ -109,14 +109,6 @@ pbc_correct_dx_simd(gmx_simd_real_t  *dx,
 {
     gmx_simd_real_t shz, shy, shx;
 
-#if defined _MSC_VER && _MSC_VER < 1700 && !defined(__ICL)
-    /* The caller side should make sure we never end up here.
-     * TODO Black-list _MSC_VER < 1700 when it's old enough, so we can rid
-     * of this code complication.
-     */
-    gmx_incons("pbc_correct_dx_simd was called for code compiled with MSVC 2010 or older, which produces incorrect code (probably corrupts memory) and therefore this function should not have been called");
-#endif
-
     shz = gmx_simd_round_r(gmx_simd_mul_r(*dz, pbc->inv_bzz));
     *dx = gmx_simd_fnmadd_r(shz, pbc->bzx, *dx);
     *dy = gmx_simd_fnmadd_r(shz, pbc->bzy, *dy);
index 4c864432341baf91f84499cdd15d380b83ed33f7..b65af7c791c0066dc00007c3f9c8ac639984d1b5 100644 (file)
@@ -150,7 +150,7 @@ extern int _gmx_sel_yydebug;
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -2690,7 +2690,7 @@ yyreduce:
                  BEGIN_ACTION;
                  SelectionParserParameterListPointer list(get((yyvsp[(1) - (2)].plist)));
                  list->push_back(get((yyvsp[(2) - (2)].param)));
-                 set((yyval.plist), move(list));
+                 set((yyval.plist), std::move(list));
                  END_ACTION;
              }
     break;
@@ -2735,7 +2735,7 @@ yyreduce:
                  BEGIN_ACTION;
                  SelectionParserValueListPointer list(get((yyvsp[(1) - (2)].vlist)));
                  list->push_back(get((yyvsp[(2) - (2)].val)));
-                 set((yyval.vlist), move(list));
+                 set((yyval.vlist), std::move(list));
                  END_ACTION;
              }
     break;
@@ -2747,7 +2747,7 @@ yyreduce:
                  BEGIN_ACTION;
                  SelectionParserValueListPointer list(get((yyvsp[(1) - (3)].vlist)));
                  list->push_back(get((yyvsp[(3) - (3)].val)));
-                 set((yyval.vlist), move(list));
+                 set((yyval.vlist), std::move(list));
                  END_ACTION;
              }
     break;
@@ -2781,7 +2781,7 @@ yyreduce:
                  BEGIN_ACTION;
                  SelectionParserValueListPointer list(get((yyvsp[(1) - (2)].vlist)));
                  list->push_back(get((yyvsp[(2) - (2)].val)));
-                 set((yyval.vlist), move(list));
+                 set((yyval.vlist), std::move(list));
                  END_ACTION;
              }
     break;
@@ -2793,7 +2793,7 @@ yyreduce:
                  BEGIN_ACTION;
                  SelectionParserValueListPointer list(get((yyvsp[(1) - (3)].vlist)));
                  list->push_back(get((yyvsp[(3) - (3)].val)));
-                 set((yyval.vlist), move(list));
+                 set((yyval.vlist), std::move(list));
                  END_ACTION;
              }
     break;
index 3a70dcf359f27299ebcad975b04262bca8e98b5c..2e9a7611ee168993a43bbdfe37a5103cba1c700a 100644 (file)
@@ -46,7 +46,7 @@ extern int _gmx_sel_yydebug;
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index c7f676ccaf9893ebaeee3bb13ceab7a03bca8976..3cae4446e4b871ea13e06845dd0b4a70418d85eb 100644 (file)
@@ -674,7 +674,7 @@ method_param_list:
                  BEGIN_ACTION;
                  SelectionParserParameterListPointer list(get($1));
                  list->push_back(get($2));
-                 set($$, move(list));
+                 set($$, std::move(list));
                  END_ACTION;
              }
 ;
@@ -705,7 +705,7 @@ value_list_contents:
                  BEGIN_ACTION;
                  SelectionParserValueListPointer list(get($1));
                  list->push_back(get($2));
-                 set($$, move(list));
+                 set($$, std::move(list));
                  END_ACTION;
              }
            | value_list_contents ',' value_item
@@ -713,7 +713,7 @@ value_list_contents:
                  BEGIN_ACTION;
                  SelectionParserValueListPointer list(get($1));
                  list->push_back(get($3));
-                 set($$, move(list));
+                 set($$, std::move(list));
                  END_ACTION;
              }
 ;
@@ -735,7 +735,7 @@ basic_value_list_contents:
                  BEGIN_ACTION;
                  SelectionParserValueListPointer list(get($1));
                  list->push_back(get($2));
-                 set($$, move(list));
+                 set($$, std::move(list));
                  END_ACTION;
              }
            | basic_value_list_contents ',' basic_value_item
@@ -743,7 +743,7 @@ basic_value_list_contents:
                  BEGIN_ACTION;
                  SelectionParserValueListPointer list(get($1));
                  list->push_back(get($3));
-                 set($$, move(list));
+                 set($$, std::move(list));
                  END_ACTION;
              }
 ;
index 379dc199387ff12c87b628cb49c6b327e0087cd0..c84a98905bcee8662234dce582897c153f790e84 100644 (file)
@@ -46,8 +46,6 @@
 #ifndef GMX_SELECTION_PARSER_INTERNAL_H
 #define GMX_SELECTION_PARSER_INTERNAL_H
 
-#include "config.h"
-
 #include <exception>
 
 #include <boost/exception_ptr.hpp>
@@ -151,26 +149,13 @@ yyerror(YYLTYPE *location, yyscan_t scanner, char const *s)
     }
 //!\}
 
-#if !GMX_CXX11
-//! No-op to enable use of same get()/set() implementation as with C++11.
-static gmx::SelectionParserValue &move(gmx::SelectionParserValue &src)
-{
-    return src;
-}
-//! No-op to enable use of same get()/set() implementation as with C++11.
-static gmx::SelectionParserParameter &move(gmx::SelectionParserParameter &src)
-{
-    return src;
-}
-#endif
-
 /*! \brief
  * Retrieves a semantic value.
  *
  * \param[in] src  Semantic value to get the value from.
  * \returns   Retrieved value.
  * \throws    unspecified  Any exception thrown by the move constructor of
- *      ValueType (copy constructor if GMX_CXX11 is 0).
+ *      ValueType.
  *
  * There should be no statements that may throw exceptions in actions before
  * this function has been called for all semantic values that have a C++ object
@@ -186,7 +171,7 @@ ValueType get(ValueType *src)
 {
     GMX_RELEASE_ASSERT(src != NULL, "Semantic value pointers should be non-NULL");
     boost::scoped_ptr<ValueType> srcGuard(src);
-    return ValueType(move(*src));
+    return ValueType(std::move(*src));
 }
 /*! \brief
  * Sets a semantic value.
@@ -196,7 +181,7 @@ ValueType get(ValueType *src)
  * \param[in]  value Value to put into the semantic value.
  * \throws     std::bad_alloc if out of memory.
  * \throws     unspecified  Any exception thrown by the move constructor of
- *      ValueType (copy constructor if GMX_CXX11 is 0).
+ *      ValueType.
  *
  * This should be the last statement before ::END_ACTION, except for a
  * possible ::CHECK_SEL.
@@ -204,7 +189,7 @@ ValueType get(ValueType *src)
 template <typename ValueType> static
 void set(ValueType * &dest, ValueType value)
 {
-    dest = new ValueType(move(value));
+    dest = new ValueType(std::move(value));
 }
 /*! \brief
  * Sets an empty semantic value.
index d1eb39fcf3081e1f5e1769c12b36677cea8d2f9e..197d6b5f574b8c124289ad355fb73c82f1430eda 100644 (file)
@@ -359,7 +359,7 @@ SelectionParserParameter::SelectionParserParameter(
         SelectionParserValueListPointer  values,
         const SelectionLocation         &location)
     : name_(name != NULL ? name : ""), location_(location),
-      values_(values ? move(values)
+      values_(values ? std::move(values)
               : SelectionParserValueListPointer(new SelectionParserValueList))
 {
 }
@@ -734,7 +734,7 @@ init_keyword_internal(gmx_ana_selmethod_t *method,
         params.push_back(
                 SelectionParserParameter::createFromExpression(NULL, child));
         params.push_back(
-                SelectionParserParameter::create(NULL, move(args), location));
+                SelectionParserParameter::create(NULL, std::move(args), location));
         _gmx_sel_parse_params(params, root->u.expr.method->nparams,
                               root->u.expr.method->param, root, scanner);
     }
@@ -758,7 +758,7 @@ _gmx_sel_init_keyword(gmx_ana_selmethod_t *method,
                       gmx::SelectionParserValueListPointer args,
                       const char *rpost, yyscan_t scanner)
 {
-    return init_keyword_internal(method, gmx::eStringMatchType_Auto, move(args),
+    return init_keyword_internal(method, gmx::eStringMatchType_Auto, std::move(args),
                                  rpost, scanner);
 }
 
@@ -783,7 +783,7 @@ _gmx_sel_init_keyword_strmatch(gmx_ana_selmethod_t *method,
                        "String keyword method called for a non-string-valued method");
     GMX_RELEASE_ASSERT(args && !args->empty(),
                        "String keyword matching method called without any values");
-    return init_keyword_internal(method, matchType, move(args), rpost, scanner);
+    return init_keyword_internal(method, matchType, std::move(args), rpost, scanner);
 }
 
 /*!
@@ -1193,7 +1193,7 @@ _gmx_sel_append_selection(const gmx::SelectionTreeElementPointer &sel,
             gmx::SelectionDataPointer selPtr(
                     new gmx::internal::SelectionData(
                             sel.get(), _gmx_sel_lexer_pselstr(scanner)));
-            sc->sel.push_back(gmx::move(selPtr));
+            sc->sel.push_back(std::move(selPtr));
         }
     }
     /* Clear the selection string now that we've saved it */
index 3e0d5f49e4ceb3aa9e7ebe8f6b292d30bbbd0290..d1b051267f041bc08361861277eec6fb401aac56 100644 (file)
 
 #include <exception>
 #include <list>
+#include <memory>
 #include <string>
 
 #include "gromacs/math/vec.h"
 #include "gromacs/math/vectypes.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/real.h"
-#include "gromacs/utility/uniqueptr.h"
 
 #include "selelem.h"
 #include "selvalue.h"
@@ -92,7 +92,7 @@ class SelectionParserValue;
 typedef std::list<SelectionParserValue>
     SelectionParserValueList;
 //! Smart pointer type for managing a SelectionParserValueList.
-typedef gmx::gmx_unique_ptr<SelectionParserValueList>::type
+typedef std::unique_ptr<SelectionParserValueList>
     SelectionParserValueListPointer;
 
 /*! \internal
@@ -123,7 +123,7 @@ class SelectionParserValue
         {
             SelectionParserValueListPointer list(new SelectionParserValueList);
             list->push_back(value);
-            return move(list);
+            return std::move(list);
         }
         /*! \brief
          * Allocates and initializes an expression value.
@@ -290,7 +290,7 @@ class SelectionParserParameter;
 typedef std::list<SelectionParserParameter>
     SelectionParserParameterList;
 //! Smart pointer type for managing a SelectionParserParameterList.
-typedef gmx::gmx_unique_ptr<SelectionParserParameterList>::type
+typedef std::unique_ptr<SelectionParserParameterList>
     SelectionParserParameterListPointer;
 
 /*! \internal \brief
@@ -301,6 +301,23 @@ typedef gmx::gmx_unique_ptr<SelectionParserParameterList>::type
 class SelectionParserParameter
 {
     public:
+        // Default move constructor and assignment. Only needed for old compilers.
+        //! \cond
+        SelectionParserParameter(SelectionParserParameter &&o)
+            : name_(std::move(o.name_)), location_(std::move(o.location_)),
+              values_(std::move(o.values_))
+        {
+        }
+
+        SelectionParserParameter &operator=(SelectionParserParameter &&o)
+        {
+            name_     = std::move(o.name_);
+            location_ = std::move(o.location_);
+            values_   = std::move(o.values_);
+            return *this;
+        }
+        //! \endcond
+
         //! Allocates and initializes an empty parameter list.
         static SelectionParserParameterListPointer createList()
         {
@@ -320,14 +337,14 @@ class SelectionParserParameter
         create(const char *name, SelectionParserValueListPointer values,
                const SelectionLocation &location)
         {
-            return SelectionParserParameter(name, move(values), location);
+            return SelectionParserParameter(name, std::move(values), location);
         }
         //! \copydoc create(const char *, SelectionParserValueListPointer, const SelectionLocation &)
         static SelectionParserParameter
         create(const std::string &name, SelectionParserValueListPointer values,
                const SelectionLocation &location)
         {
-            return SelectionParserParameter(name.c_str(), move(values), location);
+            return SelectionParserParameter(name.c_str(), std::move(values), location);
         }
         /*! \brief
          * Allocates and initializes a parsed method parameter.
index b92ecf4c62dd2f3acdccfd308ded30aa91e6dd85..c73c7fe71b7b420fc9150a6cf5bf6f2661e37ed7 100644 (file)
@@ -45,6 +45,7 @@
 #ifndef GMX_SELECTION_SELECTIONCOLLECTION_IMPL_H
 #define GMX_SELECTION_SELECTIONCOLLECTION_IMPL_H
 
+#include <memory>
 #include <string>
 #include <vector>
 
@@ -54,7 +55,6 @@
 #include "gromacs/selection/indexutil.h"
 #include "gromacs/selection/selection.h" // For gmx::SelectionList
 #include "gromacs/selection/selectioncollection.h"
-#include "gromacs/utility/uniqueptr.h"
 
 #include "poscalc.h"
 #include "selelem.h"
@@ -68,7 +68,7 @@ namespace gmx
 {
 
 //! Smart pointer for managing an internal selection data object.
-typedef gmx_unique_ptr<internal::SelectionData>::type SelectionDataPointer;
+typedef std::unique_ptr<internal::SelectionData> SelectionDataPointer;
 //! Container for storing a list of selections internally.
 typedef std::vector<SelectionDataPointer> SelectionDataList;
 
index 0a29722728ae9fce6cf1803696842c0e80750bbd..d564495e13b14a2daae82ecd8c8f3dac9d66e535 100644 (file)
@@ -797,7 +797,7 @@ HelpTopicPointer createSelectionHelpTopic()
     root->registerSubTopic<SimpleHelpTopic<EvaluationHelpText> >();
     root->registerSubTopic<SimpleHelpTopic<LimitationsHelpText> >();
     root->registerSubTopic<SimpleHelpTopic<ExamplesHelpText> >();
-    return move(root);
+    return std::move(root);
 }
 //! \endcond
 
index 3e009ff50cc35bfd00fd00a28e4c65ec63ef3492..34f63ae9b1cf791283c3a014055ebfb1f24701bc 100644 (file)
@@ -44,6 +44,7 @@
 #include "symrec.h"
 
 #include <map>
+#include <memory>
 #include <string>
 #include <utility>
 
@@ -51,7 +52,6 @@
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/stringutil.h"
-#include "gromacs/utility/uniqueptr.h"
 
 #include "poscalc.h"
 #include "selelem.h"
@@ -148,7 +148,7 @@ class SelectionParserSymbolTable::Impl
 {
     public:
         //! Smart pointer type for managing a SelectionParserSymbol.
-        typedef gmx::gmx_unique_ptr<SelectionParserSymbol>::type
+        typedef std::unique_ptr<SelectionParserSymbol>
             SymbolPointer;
         //! Container type for the list of symbols.
         typedef std::map<std::string, SymbolPointer> SymbolMap;
@@ -171,7 +171,7 @@ class SelectionParserSymbolTable::Impl
 void
 SelectionParserSymbolTable::Impl::addSymbol(SymbolPointer symbol)
 {
-    symbols_.insert(std::make_pair(symbol->name(), move(symbol)));
+    symbols_.insert(std::make_pair(symbol->name(), std::move(symbol)));
 }
 
 void
@@ -195,7 +195,7 @@ SelectionParserSymbolTable::Impl::addReservedSymbols()
         SymbolPointer sym(new SelectionParserSymbol(
                                   new SelectionParserSymbol::Impl(
                                           SelectionParserSymbol::ReservedSymbol, sym_reserved[i])));
-        addSymbol(move(sym));
+        addSymbol(std::move(sym));
     }
 }
 
@@ -209,7 +209,7 @@ SelectionParserSymbolTable::Impl::addPositionSymbols()
         SymbolPointer sym(new SelectionParserSymbol(
                                   new SelectionParserSymbol::Impl(
                                           SelectionParserSymbol::PositionSymbol, postypes[i])));
-        addSymbol(move(sym));
+        addSymbol(std::move(sym));
     }
 }
 
@@ -378,7 +378,7 @@ SelectionParserSymbolTable::addVariable(const char                             *
                                     new SelectionParserSymbol::Impl(
                                             SelectionParserSymbol::VariableSymbol, name)));
     sym->impl_->var_ = sel;
-    impl_->addSymbol(move(sym));
+    impl_->addSymbol(std::move(sym));
 }
 
 void
@@ -395,7 +395,7 @@ SelectionParserSymbolTable::addMethod(const char          *name,
                                     new SelectionParserSymbol::Impl(
                                             SelectionParserSymbol::MethodSymbol, name)));
     sym->impl_->meth_ = method;
-    impl_->addSymbol(move(sym));
+    impl_->addSymbol(std::move(sym));
 }
 
 } // namespace gmx
index 1608a5b11b599847c823f1db12454413dfca30ca..43d865543a9b0942143cc7e530128f9e28de436d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -43,6 +43,7 @@
 
 #include "gromacs/selection/poscalc.h"
 
+#include <memory>
 #include <vector>
 
 #include <gtest/gtest.h>
@@ -53,7 +54,6 @@
 #include "gromacs/selection/position.h"
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/uniqueptr.h"
 
 #include "testutils/refdata.h"
 
@@ -125,16 +125,30 @@ class PositionCalculationTest : public ::testing::Test
         gmx::PositionCalculationCollection  pcc_;
 
     private:
-        typedef gmx::gmx_unique_ptr<gmx_ana_pos_t>::type PositionPointer;
+        typedef std::unique_ptr<gmx_ana_pos_t> PositionPointer;
 
         struct PositionTest
         {
             PositionTest(PositionPointer pos, gmx_ana_poscalc_t *pc,
                          const char *name)
-                : pos(gmx::move(pos)), pc(pc), name(name)
+                : pos(std::move(pos)), pc(pc), name(name)
             {
             }
 
+            // Default move constructor and assignment. Only needed for old compilers.
+            PositionTest(PositionTest &&o)
+                : pos(std::move(o.pos)), pc(o.pc), name(o.name)
+            {
+            }
+
+            PositionTest &operator= (PositionTest &&o)
+            {
+                pos  = std::move(o.pos);
+                pc   = o.pc;
+                name = o.name;
+                return *this;
+            }
+
             PositionPointer                 pos;
             gmx_ana_poscalc_t              *pc;
             const char                     *name;
@@ -213,7 +227,7 @@ PositionCalculationTest::initPositions(gmx_ana_poscalc_t *pc, const char *name)
     posList_.reserve(posList_.size() + 1);
     PositionPointer p(new gmx_ana_pos_t());
     gmx_ana_pos_t  *result = p.get();
-    posList_.push_back(PositionTest(gmx::move(p), pc, name));
+    posList_.push_back(PositionTest(std::move(p), pc, name));
     gmx_ana_poscalc_init_pos(pc, result);
     return result;
 }
index 056d3ac5ef858ea810dbebc759cc0d573b9f48cd..aabcc3f39f67afb78c7f95e8be12a33f04195244 100644 (file)
@@ -349,7 +349,7 @@ TrajectoryAnalysisCommandLineRunner::registerModule(
 {
     CommandLineModulePointer module(
             new Impl::RunnerCommandLineModule(name, description, factory));
-    manager->addModule(move(module));
+    manager->addModule(std::move(module));
 }
 
 } // namespace gmx
index 158328682137cd280997fc8f5b5361f03171b819..121e9e3f8657e34c5600f95bbcf6728727ee9d0f 100644 (file)
  * The header qsort_threadsafe.h provides a guaranteed threadsafe
  * implementation for qsort().
  *
- * The header uniqueptr.h declares gmx::gmx_unique_ptr, which is intended for
- * declaring smart pointer types with unique ownership.
- *
  * \endif
  *
  * \author Teemu Murtola <teemu.murtola@gmail.com>
index 1b1e2bdf175e9cb7e26896dc6b2530096ca4d343..4da4a1ebff567d6995b14dc8efe7943776836fcb 100644 (file)
@@ -43,8 +43,6 @@
 #ifndef GMX_UTILITY_SCOPED_PTR_SFREE_H
 #define GMX_UTILITY_SCOPED_PTR_SFREE_H
 
-#include "config.h"
-
 #include "gromacs/utility/classhelpers.h"
 #include "gromacs/utility/smalloc.h"
 
@@ -89,10 +87,7 @@ class scoped_cptr
         //! Returns the stored pointer.
         T *get() const { return ptr_; }
         //! Check for non-null pointer in boolean context.
-#if GMX_CXX11
-        explicit
-#endif
-        operator bool () const { return ptr_ != 0; }
+        explicit operator bool () const { return ptr_ != 0; }
         //! Sets the pointer and frees previous pointer if necessary.
         void reset(T *ptr) { D(ptr_); ptr_ = ptr; }
         //! Clears the pointer without freeing the memory, and returns the old value.
diff --git a/src/gromacs/utility/uniqueptr.h b/src/gromacs/utility/uniqueptr.h
deleted file mode 100644 (file)
index ad9c7fc..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*! \libinternal \file
- * \brief
- * Declares gmx::gmx_unique_ptr and supporting functionality.
- *
- * \author Roland Schulz <roland@utk.edu>
- * \author John Eblen <jeblen@acm.org>
- * \inlibraryapi
- * \ingroup module_utility
- */
-#ifndef GMX_UTILITY_UNIQUEPTR_H
-#define GMX_UTILITY_UNIQUEPTR_H
-
-#include "config.h"
-
-#if GMX_CXX11      // C++11 Compiler
-#include <memory>  // IWYU pragma: export
-#include <utility> // IWYU pragma: export
-#else              // C++03 Compiler
-#include <boost/shared_ptr.hpp>
-#endif
-
-namespace gmx
-{
-
-//! \cond libapi
-/*! \libinternal \class gmx_unique_ptr
- * \brief
- * Smart pointer for unique ownership.
- *
- * The \a type member typedef declares the actual smart pointer type.
- * If std::unique_ptr from C++11 is available, it is used, otherwise maps to
- * boost::shared_ptr. Because of this, there are some limitations to usage.
- * gmx::move() should be used to move the pointer.
- *
- * Avoid using directly as a type, use a typedef instead. Typical usage:
- * \code
-   typedef gmx_unique_ptr<ExampleClass>::type ExampleClassPointer;
-   \endcode
- *
- * \ingroup module_utility
- * \inlibraryapi
- */
-/*! \libinternal \typedef gmx_unique_ptr::type
- * \brief The smart pointer type.
- * Work-around for the non-existence of template typedefs in C++03.
- */
-#if GMX_CXX11 // C++11 Compiler
-using std::move;
-template<typename T>
-struct gmx_unique_ptr
-{
-    typedef std::unique_ptr<T> type;
-};
-#else // C++03 Compiler
-/*! \fn boost::shared_ptr<T> &move(boost::shared_ptr<T> &ptr)
- * \brief
- * Moves gmx::gmx_unique_ptr type pointers
- *
- * For C++11 gmx::move is the std::move, for non-C++11 compilers, the
- * move operation is a no-op.
- *
- * \inlibraryapi
- */
-template<typename T>
-boost::shared_ptr<T> &move(boost::shared_ptr<T> &ptr)
-{
-    return ptr;
-}
-template<typename T>
-struct gmx_unique_ptr
-{
-    typedef boost::shared_ptr<T> type;
-};
-#endif
-//! \endcond
-
-} // namespace gmx
-
-#endif
index 2b3a9b40dc26c645133f25ce126f871c2047aa62..4aa00b2d477919e51288fb41f39c351f4e12b4ce 100644 (file)
@@ -195,7 +195,7 @@ void registerModuleNoNice(gmx::CommandLineModuleManager                *manager,
 {
     gmx::CommandLineModulePointer module(
             new NoNiceModule(name, shortDescription, mainFunction));
-    manager->addModule(move(module));
+    manager->addModule(std::move(module));
 }
 
 /*! \brief
@@ -208,7 +208,7 @@ void registerObsoleteTool(gmx::CommandLineModuleManager *manager,
                           const char                    *name)
 {
     gmx::CommandLineModulePointer module(new ObsoleteToolModule(name));
-    manager->addModule(move(module));
+    manager->addModule(std::move(module));
 }
 
 } // namespace
index 2196fe553250b5e7d1e2716e0bc5496f3bc7641e..9c35c68c9b25345ba59fae52bc9fc0425eaa7c1b 100644 (file)
  * \ingroup module_mdrun
  */
 
+#include <memory>
 #include <string>
 
 #include <gtest/gtest.h>
 
-#include "gromacs/utility/uniqueptr.h"
-
 #include "testutils/cmdlinetest.h"
 
 #include "moduletest.h"
@@ -59,7 +58,7 @@ namespace test
 {
 
 //! Convenience typedef
-typedef gmx_unique_ptr<CommandLine>::type CommandLinePointer;
+typedef std::unique_ptr<CommandLine> CommandLinePointer;
 
 class MultiSimTest : public gmx::test::ParameterizedMdrunTestFixture
 {
index 2a3354062fd4bd21d4dce6b80e3484a2e3e7c418..b63111fef952e5c813e19ec4aca7e29d3fbe5d65 100644 (file)
 #define GMX_TESTUTILS_REFDATA_IMPL_H
 
 #include <list>
+#include <memory>
 #include <string>
 
 #include "gromacs/utility/gmxassert.h"
-#include "gromacs/utility/uniqueptr.h"
 
 namespace gmx
 {
@@ -56,7 +56,7 @@ namespace test
 class ReferenceDataEntry
 {
     public:
-        typedef gmx_unique_ptr<ReferenceDataEntry>::type EntryPointer;
+        typedef std::unique_ptr<ReferenceDataEntry> EntryPointer;
         typedef std::list<EntryPointer> ChildList;
         typedef ChildList::const_iterator ChildIterator;