From cbec8c8f030d59fd8a6d90cb9a18bdf4c9a9caed Mon Sep 17 00:00:00 2001 From: Oliver Hahn Date: Sat, 12 Oct 2019 15:06:49 +0200 Subject: [PATCH] inlined global lambdas, requires upgrading to C++17 --- CMakeLists.txt | 2 +- include/operators.hh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fcc57e9..875fc91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,7 +84,7 @@ file( GLOB PLUGINS add_executable(${PRGNAME} ${SOURCES} ${PLUGINS}) target_setup_class(${PRGNAME}) -set_target_properties(${PRGNAME} PROPERTIES CXX_STANDARD 14) +set_target_properties(${PRGNAME} PROPERTIES CXX_STANDARD 17) # mpi flags if(MPI_CXX_FOUND) diff --git a/include/operators.hh b/include/operators.hh index 0177f95..cc0ed67 100644 --- a/include/operators.hh +++ b/include/operators.hh @@ -1,9 +1,9 @@ #pragma once namespace op{ -auto assign_to = [](auto &g){return [&](auto i, auto v){ g[i] = v; };}; -auto add_to = [](auto &g){return [&](auto i, auto v){ g[i] += v; };}; -auto add_twice_to = [](auto &g){return [&](auto i, auto v){ g[i] += 2*v; };}; -auto subtract_from = [](auto &g){return [&](auto i, auto v){ g[i] -= v; };}; -auto subtract_twice_from = [](auto &g){return [&](auto i, auto v){ g[i] -= 2*v; };}; -} \ No newline at end of file +inline auto assign_to = [](auto &g){return [&](auto i, auto v){ g[i] = v; };}; +inline auto add_to = [](auto &g){return [&](auto i, auto v){ g[i] += v; };}; +inline auto add_twice_to = [](auto &g){return [&](auto i, auto v){ g[i] += 2*v; };}; +inline auto subtract_from = [](auto &g){return [&](auto i, auto v){ g[i] -= v; };}; +inline auto subtract_twice_from = [](auto &g){return [&](auto i, auto v){ g[i] -= 2*v; };}; +}