Go to the documentation of this file.
9 #ifndef EAGINE_OVERLOADED_HPP
10 #define EAGINE_OVERLOADED_HPP
16 template <
typename... Func>
19 template <
typename Func>
20 struct overloaded<Func> : Func {
21 overloaded(
const Func& func)
24 overloaded(Func&& func)
25 : Func{std::move(func)} {}
27 using Func::operator();
30 template <
typename Func,
typename... Funcs>
31 struct overloaded<Func, Funcs...>
33 , overloaded<Funcs...> {
34 template <
typename... F>
35 overloaded(
const Func& func, F&&... funcs)
37 , overloaded<Funcs...>{std::forward<Funcs>(funcs)...} {}
39 template <
typename... F>
40 overloaded(Func&& func, F&&... funcs)
41 : Func{std::move(func)}
42 , overloaded<Funcs...>{std::forward<Funcs>(funcs)...} {}
44 using Func::operator();
45 using overloaded<Funcs...>::operator();
48 template <
typename... F>
49 overloaded(
const F&...) -> overloaded<F...>;
53 #endif // EAGINE_OVERLOADED_HPP
Common code is placed in this namespace.
Definition: eagine.hpp:21