Nui
visit_overloaded.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <variant>
6 
7 namespace Nui
8 {
9  template <typename... VariantTypes, typename... VisitFunctionTypes>
10  auto visitOverloaded(std::variant<VariantTypes...> const& variant, VisitFunctionTypes&&... visitFunctions)
11  {
12  return std::visit(overloaded{std::forward<VisitFunctionTypes>(visitFunctions)...}, variant);
13  }
14 
15  template <typename... VariantTypes, typename... VisitFunctionTypes>
16  auto visitOverloaded(std::variant<VariantTypes...>&& variant, VisitFunctionTypes&&... visitFunctions)
17  {
18  return std::visit(overloaded{std::forward<VisitFunctionTypes>(visitFunctions)...}, std::move(variant));
19  }
20 
21 }
Definition: file_dialog.hpp:6
auto visitOverloaded(std::variant< VariantTypes... > const &variant, VisitFunctionTypes &&... visitFunctions)
Definition: visit_overloaded.hpp:10
Definition: overloaded.hpp:7