MCPcopy Create free account
hub / github.com/davisking/dlib / apply

Function apply

dlib/functional.h:267–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265
266 template<typename F, typename Tuple>
267 constexpr auto apply(F&& fn, Tuple&& tpl)
268 /*!
269 ensures
270 - identical to std::apply(std::forward<F>(f), std::forward<Tuple>(tpl))
271 - works with C++11 onwards
272 !*/
273 noexcept(noexcept(detail::apply_impl(std::forward<F>(fn),
274 std::forward<Tuple>(tpl),
275 make_index_sequence<std::tuple_size<typename std::remove_reference<Tuple>::type >::value>{})))
276 -> decltype(detail::apply_impl(std::forward<F>(fn),
277 std::forward<Tuple>(tpl),
278 make_index_sequence<std::tuple_size<typename std::remove_reference<Tuple>::type >::value>{}))
279 {
280 return detail::apply_impl(std::forward<F>(fn),
281 std::forward<Tuple>(tpl),
282 make_index_sequence<std::tuple_size<typename std::remove_reference<Tuple>::type >::value>{});
283 }
284
285// ----------------------------------------------------------------------------------------
286

Callers 2

test_functionsFunction · 0.85
test_lambdasFunction · 0.85

Calls 1

apply_implFunction · 0.85

Tested by 2

test_functionsFunction · 0.68
test_lambdasFunction · 0.68