// This source code is released into the public domain. export module nihil.util:match; import nihil.std; namespace nihil { export template struct match : Ts... { using Ts::operator()...; }; export template [[nodiscard]] constexpr decltype(auto) operator| (std::variant const &v, match const &match) { return std::visit(match, v); } } // namespace nihil