diff --git a/dlib/dnn/core.h b/dlib/dnn/core.h index 965e42e93..8366318e0 100644 --- a/dlib/dnn/core.h +++ b/dlib/dnn/core.h @@ -590,20 +590,24 @@ namespace dlib } template - struct details_constructable_from + struct disable_forwarding_constr { const static bool value = std::is_constructible::value; }; template - struct details_constructable_from,U...> + struct disable_forwarding_constr,U...> + { + const static bool value = true; + }; + template + struct disable_forwarding_constr> { - // just say true so that the constructor below never activates for tuple types. const static bool value = true; }; template < typename ...T, - typename = typename std::enable_if::value>::type + typename = typename std::enable_if::type...>::value>::type > add_layer( T&& ...args