Add overloaded
This commit is contained in:
parent
6e873fbc65
commit
a970526e4b
1 changed files with 13 additions and 0 deletions
13
include/utempl/overloaded.hpp
Normal file
13
include/utempl/overloaded.hpp
Normal 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
|
Loading…
Reference in a new issue