diff --git a/dune/common/parameterizedobject.hh b/dune/common/parameterizedobject.hh index 1b48bfa37eb9eb8839120a6d03988fb15782f3c7..bf9bbe5585c83d028c93727a4255d68dc2238692 100644 --- a/dune/common/parameterizedobject.hh +++ b/dune/common/parameterizedobject.hh @@ -135,7 +135,10 @@ class ParameterizedObjectFactory<TypeT(Args...), KeyT> * note, this does not work fundamental types */ template<class Impl, - typename std::enable_if<std::is_convertible<Impl, Type>::value, int>::type = 0> + typename std::enable_if< + std::is_convertible<Impl, Type>::value + and not std::is_convertible<Impl, Creator>::value, + int>::type = 0> void define(Key const& key, Impl&& t) { registry_[key] = [=](Args...) { return t;};