Add overloaded

This commit is contained in:
sha512sum 2024-02-27 18:40:00 +00:00
parent 6e873fbc65
commit a970526e4b

View file

@ -0,0 +1,13 @@
#pragma once
#include <utility>
namespace utempl {
template <typename... Fs>
inline constexpr auto Overloaded(Fs&&... fs) {
struct Overloaded : public std::remove_cvref_t<Fs>... {
using Fs::operator()...;
};
return Overloaded{std::forward<Fs>(fs)...};
};
} // namespace utempl