Commit 943a07cb authored by Fm's avatar Fm

Visual Studio 2015 UP3 support

parent 595f0128
......@@ -208,6 +208,8 @@ namespace dlib
};
template <typename T> struct alwaysbool { typedef bool type; };
// one more structure for VS 2015 UP3 support workaround
template <typename T> struct alwaysbool2 { typedef bool type; };
resizable_tensor& rt();
......@@ -254,7 +256,7 @@ namespace dlib
constexpr auto has_inplace_backward(
layer_type& layer,
SUBNET& sub
) -> typename alwaysbool<decltype(layer.backward(rt(),rt(),sub,rt()))>::type
) -> typename alwaysbool2<decltype(layer.backward(rt(),rt(),sub,rt()))>::type
{
return false;
}
......@@ -263,7 +265,7 @@ namespace dlib
constexpr auto has_inplace_backward(
layer_type& layer,
SUBNET& sub
) -> typename alwaysbool<decltype(layer.backward(rt(),sub,rt()))>::type
) -> typename alwaysbool2<decltype(layer.backward(rt(),sub,rt()))>::type
{
return false;
}
......@@ -272,7 +274,7 @@ namespace dlib
constexpr auto has_inplace_backward(
layer_type& layer,
SUBNET& sub
) -> typename alwaysbool<decltype(layer.backward_inplace(rt(),rt(),sub.get_gradient_input(),rt()))>::type
) -> typename alwaysbool2<decltype(layer.backward_inplace(rt(),rt(),sub.get_gradient_input(),rt()))>::type
{
return true;
}
......@@ -281,7 +283,7 @@ namespace dlib
constexpr auto has_inplace_backward(
layer_type& layer,
SUBNET& sub
) -> typename alwaysbool<decltype(layer.backward_inplace(rt(),sub.get_gradient_input(),rt()))>::type
) -> typename alwaysbool2<decltype(layer.backward_inplace(rt(),sub.get_gradient_input(),rt()))>::type
{
return true;
}
......@@ -290,7 +292,7 @@ namespace dlib
constexpr auto is_inplace_layer(
layer_type& layer,
const SUBNET& sub
) -> typename alwaysbool<decltype(layer.forward(sub,rt()))>::type
) -> typename alwaysbool2<decltype(layer.forward(sub,rt()))>::type
{
return false;
}
......
......@@ -61,7 +61,6 @@ else()
";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;" AND
";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_thread_local;" AND
";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_constexpr;" AND
";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_decltype_incomplete_return_types;" AND
";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_auto_type;")
set(COMPILER_CAN_DO_CPP_11 1)
......
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