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

Make enable_if more portable

As I learned clang is known to not work correctly
if enable_if is used in a varadic template parameter
of type 'class'. Replacing this by e.g. an int-parameter
should fix the problem.
parent b01278ce
No related branches found
No related tags found
1 merge request!4Feature/flexible loopsolver monitoring
...@@ -51,7 +51,7 @@ namespace Dune { ...@@ -51,7 +51,7 @@ namespace Dune {
* of the header string coincide to get a readable log. * of the header string coincide to get a readable log.
*/ */
template<class F, template<class F,
enable_if_t<std::is_convertible<result_of_t<F()>, Result>::value>...> enable_if_t<std::is_convertible<result_of_t<F()>, Result>::value, int> = 0>
Criterion(F&& f, const std::string& header) : Criterion(F&& f, const std::string& header) :
f_(std::forward<F>(f)), f_(std::forward<F>(f)),
header_(header) header_(header)
...@@ -75,7 +75,7 @@ namespace Dune { ...@@ -75,7 +75,7 @@ namespace Dune {
* of the header string coincide to get a readable log. * of the header string coincide to get a readable log.
*/ */
template<class F, template<class F,
enable_if_t<std::is_convertible<result_of_t<F()>, std::string>::value>...> enable_if_t<std::is_convertible<result_of_t<F()>, std::string>::value, int> = 0>
Criterion(F&& f, const std::string& header) : Criterion(F&& f, const std::string& header) :
f_( [=]() {return std::make_tuple(false, f());} ), f_( [=]() {return std::make_tuple(false, f());} ),
header_(header) header_(header)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment