Common/VariantUtil: Add 'overloaded' helper struct for use with std::variant.

This commit is contained in:
Admiral H. Curtiss 2021-01-27 02:31:46 +01:00
parent 87ae7ccd75
commit 3286d2df3d
1 changed files with 9 additions and 0 deletions

View File

@ -26,3 +26,12 @@ auto VariantCast(const std::variant<From...>& v)
{
return detail::VariantCastProxy<From...>{v};
}
template <class... Ts>
struct overloaded : Ts...
{
using Ts::operator()...;
};
template <class... Ts>
overloaded(Ts...) -> overloaded<Ts...>;