MCPcopy Create free account
hub / github.com/Icinga/icinga2 / WrapFunction

Function WrapFunction

lib/base/functionwrapper.hpp:19–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17
18template<typename FuncType>
19typename std::enable_if<
20 std::is_class<FuncType>::value &&
21 std::is_same<typename boost::function_types::result_type<decltype(&FuncType::operator())>::type, Value>::value &&
22 boost::function_types::function_arity<decltype(&FuncType::operator())>::value == 2,
23 std::function<Value (const std::vector<Value>&)>>::type
24WrapFunction(FuncType function)
25{
26 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>");
27 return function;
28}
29
30inline std::function<Value (const std::vector<Value>&)> WrapFunction(void (*function)(const std::vector<Value>&))
31{

Callers 1

FunctionMethod · 0.85

Calls 2

UnpackCallerClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected