Apply the specified visitor to this modifiable variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(). This method does not return a value. If this variant is unset, the specified defaultValue of template parameter TYPE is passed to the visitor. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless this variant is unset or holds a value of template parameter TYPE. Note that this method is selected only if the template parameter type VISITOR does not define a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
Declared in <bdlb_variant.h>
template<
class VISITOR,
class TYPE>
void
apply(
VISITOR& visitor,
TYPE const& defaultValue)
requires Variant_ReturnValueHelper<VISITOR>::value == 0;