Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template <typename ... Functions>
- struct function_array : public Functions ... {
- template <std::size_t Index>
- using at = std::tuple_element_t<Index, std::tuple<Functions ...>>;
- template <std::size_t Index, typename ... Args>
- constexpr decltype(auto) call(Args&& ... args) const
- noexcept(noexcept(std::declval<function_array>().at<Index>::operator()(std::declval<Args>() ...))) {
- return at<Index>::operator()(std::forward<Args>(args) ...);
- }
- };
- template <typename ... Functions> function_array(Functions ...) -> function_array<Functions ...>;
Add Comment
Please, Sign In to add comment