From 2ad9cd7843b74dd3aefa016477656635675a9db3 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sat, 25 Nov 2017 07:42:48 -0500 Subject: [PATCH] Fixing code for visual studio --- dlib/global_optimization/find_max_global.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dlib/global_optimization/find_max_global.h b/dlib/global_optimization/find_max_global.h index 8679038cb..aab7e487c 100644 --- a/dlib/global_optimization/find_max_global.h +++ b/dlib/global_optimization/find_max_global.h @@ -71,14 +71,14 @@ namespace dlib template struct call_function_and_expand_args { -template static auto go(T&& f, const matrix& a) -> decltype(std::forward(f), disable_decay_to_scalar(a)) {return f(disable_decay_to_scalar(a)); } -template static auto go(T&& f, const matrix& a) -> decltype(std::forward(f), a(0)) { DLIB_CASSERT(a.size() == 1); return f(a(0)); } -template static auto go(T&& f, const matrix& a) -> decltype(std::forward(f), a(0),a(1)) { DLIB_CASSERT(a.size() == 2); return f(a(0),a(1)); } -template static auto go(T&& f, const matrix& a) -> decltype(std::forward(f), a(0), a(1), a(2)) { DLIB_CASSERT(a.size() == 3); return f(a(0), a(1),a(2)); } -template static auto go(T&& f, const matrix& a) -> decltype(std::forward(f), a(0), a(1), a(2), a(3)) { DLIB_CASSERT(a.size() == 4); return f(a(0), a(1), a(2), a(3)); } -template static auto go(T&& f, const matrix& a) -> decltype(std::forward(f), a(0), a(1), a(2), a(3), a(4)) { DLIB_CASSERT(a.size() == 5); return f(a(0), a(1), a(2), a(3), a(4)); } -template static auto go(T&& f, const matrix& a) -> decltype(std::forward(f), a(0), a(1), a(2), a(3), a(4), a(5)) { DLIB_CASSERT(a.size() == 6); return f(a(0), a(1), a(2), a(3), a(4), a(5)); } -template static auto go(T&& f, const matrix& a) -> decltype(std::forward(f), a(0), a(1), a(2), a(3), a(4), a(5), a(6)) { DLIB_CASSERT(a.size() == 7); return f(a(0), a(1), a(2), a(3), a(4), a(5), a(6)); } +template static auto go(T&& f, const matrix& a) -> decltype(f(disable_decay_to_scalar(a))) {return f(disable_decay_to_scalar(a)); } +template static auto go(T&& f, const matrix& a) -> decltype(f(a(0))) { DLIB_CASSERT(a.size() == 1); return f(a(0)); } +template static auto go(T&& f, const matrix& a) -> decltype(f(a(0),a(1))) { DLIB_CASSERT(a.size() == 2); return f(a(0),a(1)); } +template static auto go(T&& f, const matrix& a) -> decltype(f(a(0), a(1), a(2))) { DLIB_CASSERT(a.size() == 3); return f(a(0), a(1),a(2)); } +template static auto go(T&& f, const matrix& a) -> decltype(f(a(0), a(1), a(2), a(3))) { DLIB_CASSERT(a.size() == 4); return f(a(0), a(1), a(2), a(3)); } +template static auto go(T&& f, const matrix& a) -> decltype(f(a(0), a(1), a(2), a(3), a(4))) { DLIB_CASSERT(a.size() == 5); return f(a(0), a(1), a(2), a(3), a(4)); } +template static auto go(T&& f, const matrix& a) -> decltype(f(a(0), a(1), a(2), a(3), a(4), a(5))) { DLIB_CASSERT(a.size() == 6); return f(a(0), a(1), a(2), a(3), a(4), a(5)); } +template static auto go(T&& f, const matrix& a) -> decltype(f(a(0), a(1), a(2), a(3), a(4), a(5), a(6))) { DLIB_CASSERT(a.size() == 7); return f(a(0), a(1), a(2), a(3), a(4), a(5), a(6)); } }; #endif }