From 119c0400a93004a4a5891f81819d351ef1f7b4b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20Gr=C3=A4ser?= <graeser@dune-project.org> Date: Thu, 3 Mar 2016 21:38:28 +0100 Subject: [PATCH] [cleanup] Use enable_if_t and result_of_t from std:: --- dune/solvers/solvers/criterion.hh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/dune/solvers/solvers/criterion.hh b/dune/solvers/solvers/criterion.hh index 54473242..cbdcb2f3 100644 --- a/dune/solvers/solvers/criterion.hh +++ b/dune/solvers/solvers/criterion.hh @@ -7,6 +7,7 @@ #include <string> #include <tuple> #include <memory> +#include <type_traits> #include <dune/common/stringutility.hh> @@ -28,12 +29,6 @@ namespace Dune { */ class Criterion { - template <typename F> - using result_of_t = typename std::result_of<F>::type; - - template <bool Condition, typename T=void> - using enable_if_t = typename std::enable_if<Condition, T>::type; - typedef std::tuple<bool, std::string> Result; public: @@ -56,7 +51,7 @@ namespace Dune { * of the header string coincide to get a readable log. */ template<class F, - enable_if_t<std::is_convertible<result_of_t<F()>, Result>::value, int> = 0> + std::enable_if_t<std::is_convertible<std::result_of_t<F()>, Result>::value, int> = 0> Criterion(F&& f, const std::string& header) : f_(std::forward<F>(f)), header_(header) @@ -80,7 +75,7 @@ namespace Dune { * of the header string coincide to get a readable log. */ template<class F, - enable_if_t<std::is_convertible<result_of_t<F()>, std::string>::value, int> = 0> + std::enable_if_t<std::is_convertible<std::result_of_t<F()>, std::string>::value, int> = 0> Criterion(F&& f, const std::string& header) : f_( [=]() {return std::make_tuple(false, f());} ), header_(header) -- GitLab