Skip to content

Commit

Permalink
Introduce auxiliary::overloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Aug 16, 2023
1 parent 7d1d75d commit 35f28c7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/openPMD/auxiliary/Variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,17 @@ namespace auxiliary
private:
resource m_data;
};

/*
* Helper type for std::visit,
* see https://en.cppreference.com/w/cpp/utility/variant/visit
*/
template <class... Ts>
struct overloaded : Ts...
{
using Ts::operator()...;
};
template <class... Ts>
overloaded(Ts...) -> overloaded<Ts...>;
} // namespace auxiliary
} // namespace openPMD

0 comments on commit 35f28c7

Please sign in to comment.