Skip to content
Snippets Groups Projects
Commit 119c0400 authored by Carsten Gräser's avatar Carsten Gräser
Browse files

[cleanup] Use enable_if_t and result_of_t from std::

parent c5f409de
No related branches found
No related tags found
1 merge request!4Feature/flexible loopsolver monitoring
Pipeline #
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment