diff --git a/include/utempl/overloaded.hpp b/include/utempl/overloaded.hpp new file mode 100644 index 0000000..ae8b3a4 --- /dev/null +++ b/include/utempl/overloaded.hpp @@ -0,0 +1,13 @@ +#pragma once +#include + +namespace utempl { +template +inline constexpr auto Overloaded(Fs&&... fs) { + struct Overloaded : public std::remove_cvref_t... { + using Fs::operator()...; + }; + return Overloaded{std::forward(fs)...}; +}; + +} // namespace utempl