Audacity 3.2.0
Namespaces | Functions
Variant Namespace Reference

Namespaces

namespace  detail
 

Functions

template<typename Visitor , typename Variant , typename VariantBase = detail::deduced_variant<Variant &&>>
decltype(auto) Visit (Visitor &&vis, Variant &&var)
 Mimic some of std::visit, for the case of one visitor only. More...
 

Function Documentation

◆ Visit()

template<typename Visitor , typename Variant , typename VariantBase = detail::deduced_variant<Variant &&>>
decltype(auto) Variant::Visit ( Visitor &&  vis,
Variant &&  var 
)

Mimic some of std::visit, for the case of one visitor only.

This is necessary because of limitations of the macOS implementation of some of the C++17 standard library without a minimum version of 10.13, and so let's use this even when not needed on the other platforms, instead of having too much conditional compilation

Definition at line 138 of file Variant.h.

139{
140 using ForwardType = std::conditional_t<std::is_lvalue_reference_v<Variant>,
141 std::add_lvalue_reference_t<VariantBase>, VariantBase>;
142 constexpr auto size = std::variant_size_v<VariantBase>;
143 return detail::VisitHelper(std::make_index_sequence<size>{},
144 std::forward<Visitor>(vis), detail::forward_variant<ForwardType>(var));
145}
decltype(auto) VisitHelper(std::index_sequence< Indices... >, Visitor &&vis, Variant &&var)
Help to define Visit() below.
Definition: Variant.h:85

References size, and Variant::detail::VisitHelper().

Referenced by PixelSampleMapper::GetFirstSample(), PixelSampleMapper::IsValid(), and Registry::VisitorFunctions< RegistryTraits, Reference >::Visit().

Here is the call graph for this function:
Here is the caller graph for this function: