Merge pull request #5928 from Icinga/fix/build-fix-msvc

Fix build problem with MSVC
This commit is contained in:
Michael Friedrich 2018-01-02 14:01:15 +01:00 committed by GitHub
commit f843f92ee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,11 +38,11 @@ template<typename FuncType>
typename std::enable_if< typename std::enable_if<
std::is_class<FuncType>::value && std::is_class<FuncType>::value &&
std::is_same<typename boost::function_types::result_type<decltype(&FuncType::operator())>::type, Value>::value && std::is_same<typename boost::function_types::result_type<decltype(&FuncType::operator())>::type, Value>::value &&
std::is_same<typename boost::mpl::at_c<boost::function_types::parameter_types<decltype(&FuncType::operator())>, 1>::type, const std::vector<Value>&>::value && boost::function_types::function_arity<decltype(&FuncType::operator())>::value == 2,
boost::function_types::function_arity<decltype(&FuncType::operator())>::value == 2,
std::function<Value (const std::vector<Value>&)>>::type std::function<Value (const std::vector<Value>&)>>::type
WrapFunction(FuncType function) WrapFunction(FuncType function)
{ {
static_assert(std::is_same<typename boost::mpl::at_c<typename boost::function_types::parameter_types<decltype(&FuncType::operator())>, 1>::type, const std::vector<Value>&>::value, "Argument type must be const std::vector<Value>");
return function; return function;
} }
@ -140,11 +140,12 @@ template<typename FuncType>
typename std::enable_if< typename std::enable_if<
std::is_class<FuncType>::value && std::is_class<FuncType>::value &&
!(std::is_same<typename boost::function_types::result_type<decltype(&FuncType::operator())>::type, Value>::value && !(std::is_same<typename boost::function_types::result_type<decltype(&FuncType::operator())>::type, Value>::value &&
std::is_same<typename boost::mpl::at_c<boost::function_types::parameter_types<decltype(&FuncType::operator())>, 1>::type, const std::vector<Value>&>::value && boost::function_types::function_arity<decltype(&FuncType::operator())>::value == 2),
boost::function_types::function_arity<decltype(&FuncType::operator())>::value == 2),
std::function<Value (const std::vector<Value>&)>>::type std::function<Value (const std::vector<Value>&)>>::type
WrapFunction(FuncType function) WrapFunction(FuncType function)
{ {
static_assert(!std::is_same<typename boost::mpl::at_c<typename boost::function_types::parameter_types<decltype(&FuncType::operator())>, 1>::type, const std::vector<Value>&>::value, "Argument type must be const std::vector<Value>");
using FuncTypeInvoker = decltype(&FuncType::operator()); using FuncTypeInvoker = decltype(&FuncType::operator());
return [function](const std::vector<Value>& arguments) { return [function](const std::vector<Value>& arguments) {