/* This file is part of the dynarmic project. * Copyright (c) 2016 MerryMage * SPDX-License-Identifier: 0BSD */ #pragma once #include namespace Dynarmic::Common { namespace detail { template struct VariantVisitor : boost::static_visitor, Lambda { VariantVisitor(Lambda&& lambda) : Lambda(std::move(lambda)) {} using Lambda::operator(); }; } // namespace detail template inline ReturnT VisitVariant(Variant&& variant, Lambda&& lambda) { return boost::apply_visitor(detail::VariantVisitor(std::move(lambda)), variant); } } // namespace Dynarmic::Common