Commit 545fe6c9 authored by Davis King's avatar Davis King

Fixed another compiler error that could happen with the forwarding constructor.

parent c5af788e
...@@ -590,20 +590,24 @@ namespace dlib ...@@ -590,20 +590,24 @@ namespace dlib
} }
template <typename T, typename ...U> template <typename T, typename ...U>
struct details_constructable_from struct disable_forwarding_constr
{ {
const static bool value = std::is_constructible<LAYER_DETAILS,T>::value; const static bool value = std::is_constructible<LAYER_DETAILS,T>::value;
}; };
template <typename ...T, typename ...U> template <typename ...T, typename ...U>
struct details_constructable_from<std::tuple<T...>,U...> struct disable_forwarding_constr<std::tuple<T...>,U...>
{
const static bool value = true;
};
template <typename ...T>
struct disable_forwarding_constr<add_layer<T...>>
{ {
// just say true so that the constructor below never activates for tuple types.
const static bool value = true; const static bool value = true;
}; };
template < template <
typename ...T, typename ...T,
typename = typename std::enable_if<!details_constructable_from<T...>::value>::type typename = typename std::enable_if<!disable_forwarding_constr<typename std::remove_reference<T>::type...>::value>::type
> >
add_layer( add_layer(
T&& ...args T&& ...args
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment