[#BloombergLP-bdlb-Variant12-apply] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/Variant12.adoc[Variant12]::apply :relfileprefix: ../../../ :mrdocs: `apply` overloads == Synopses Declared in `<bdlb_variant.h>` Apply the specified `visitor` to this modifiable variant by passing the value this variant currently holds to the `visitor` object's `operator()`, and return the value returned by the `visitor`. If this variant is unset, a default constructed `bslmf::Nil` is passed to the `visitor`. Note that this method is selected only if the template parameter type `VISITOR` defines 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class VISITOR> VISITOR::ResultType xref:BloombergLP/bdlb/VariantImp/apply-0ec.adoc[apply](VISITOR& visitor) requires Variant_ReturnValueHelper<VISITOR>::value == 1; ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-0ec.adoc[_» more..._]# Apply the specified `visitor` to this variant by passing the value this variant currently holds to the `visitor` object's `operator()`, and return the value returned by the `visitor`. If this variant is unset, a default constructed `bslmf::Nil` is passed to the `visitor`. Note that this method is selected only if the template parameter type `VISITOR` defines 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class VISITOR> VISITOR::ResultType xref:BloombergLP/bdlb/VariantImp/apply-073.adoc[apply](VISITOR& visitor) const requires Variant_ReturnValueHelper<VISITOR>::value == 1; ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-073.adoc[_» more..._]# Apply the specified `visitor` to this modifiable variant by passing the value this variant currently holds to the `visitor` object's `operator()`, and return the value returned by the `visitor`. If If this variant is unset, a default constructed `bslmf::Nil` is passed to the `visitor`. Note that this method is selected only if the template parameter type `VISITOR` defines 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class VISITOR> VISITOR::ResultType xref:BloombergLP/bdlb/VariantImp/apply-034.adoc[apply](VISITOR const& visitor) requires Variant_ReturnValueHelper<VISITOR>::value == 1; ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-034.adoc[_» more..._]# Apply the specified `visitor` to this variant by passing the value this variant currently holds to the `visitor` object's `operator()`, and return the value returned by the 'visitor. If this variant is unset, a default constructed `bslmf::Nil` is passed to the `visitor`. Note that this method is selected only if the template parameter type `VISITOR` defines 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class VISITOR> VISITOR::ResultType xref:BloombergLP/bdlb/VariantImp/apply-00.adoc[apply](VISITOR const& visitor) const requires Variant_ReturnValueHelper<VISITOR>::value == 1; ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-00.adoc[_» more..._]# 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()`, and return the value (of template parameter `RET_TYPE`) returned by the `visitor`. If this variant is unset, a default constructed `bslmf::Nil` is passed to the `visitor`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class RET_TYPE, class VISITOR> RET_TYPE xref:BloombergLP/bdlb/VariantImp/apply-02f.adoc[apply](VISITOR& visitor); ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-02f.adoc[_» more..._]# Apply the specified `visitor` to this variant by passing the value this variant currently holds to the `visitor` object's `operator()`, and return the value (of template parameter `RET_TYPE`) returned by the `visitor`. If this variant is unset, a default constructed `bslmf::Nil` is passed to the `visitor`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class RET_TYPE, class VISITOR> RET_TYPE xref:BloombergLP/bdlb/VariantImp/apply-0f6.adoc[apply](VISITOR& visitor) const; ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-0f6.adoc[_» more..._]# Same as the preceding overload, but for a `const` visitor. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class RET_TYPE, class VISITOR> RET_TYPE xref:BloombergLP/bdlb/VariantImp/apply-062.adoc[apply](VISITOR const& visitor); ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-062.adoc[_» more..._]# Apply the specified `visitor` to this variant by passing the value this variant currently holds to the `visitor` object's `operator()`, and return the value (of template parameter `RET_TYPE`) returned by the `visitor`. If this variant is unset, a default constructed `bslmf::Nil` is passed to the `visitor`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class RET_TYPE, class VISITOR> RET_TYPE xref:BloombergLP/bdlb/VariantImp/apply-0a.adoc[apply](VISITOR const& visitor) const; ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-0a.adoc[_» more..._]# 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()`, and return the value returned by the `visitor`. 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` defines 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VISITOR, class TYPE> VISITOR::ResultType xref:BloombergLP/bdlb/VariantImp/apply-08.adoc[apply]( VISITOR& visitor, TYPE const& defaultValue) requires Variant_ReturnValueHelper<VISITOR>::value == 1; ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-08.adoc[_» more..._]# Apply the specified `visitor` to this variant by passing the value (of template parameter `TYPE`) this variant currently holds to the `visitor` object's `operator()`, and return the value returned by the `visitor`. 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` defines 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VISITOR, class TYPE> VISITOR::ResultType xref:BloombergLP/bdlb/VariantImp/apply-0e2.adoc[apply]( VISITOR& visitor, TYPE const& defaultValue) const requires Variant_ReturnValueHelper<VISITOR>::value == 1; ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-0e2.adoc[_» more..._]# 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()`, and return the value returned by the `visitor`. 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` defines 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VISITOR, class TYPE> VISITOR::ResultType xref:BloombergLP/bdlb/VariantImp/apply-021.adoc[apply]( VISITOR const& visitor, TYPE const& defaultValue) requires Variant_ReturnValueHelper<VISITOR>::value == 1; ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-021.adoc[_» more..._]# Apply the specified `visitor` to this variant by passing the value (of template parameter `TYPE`) this variant currently holds to the `visitor` object's `operator()`, and return the value returned by the `visitor`. 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` defines 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class VISITOR, class TYPE> VISITOR::ResultType xref:BloombergLP/bdlb/VariantImp/apply-075f.adoc[apply]( VISITOR const& visitor, TYPE const& defaultValue) const requires Variant_ReturnValueHelper<VISITOR>::value == 1; ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-075f.adoc[_» more..._]# 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()`, and return the value (of template parameter `RET_TYPE`) returned by the `visitor`. 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`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class RET_TYPE, class VISITOR, class TYPE> RET_TYPE xref:BloombergLP/bdlb/VariantImp/apply-028.adoc[apply]( VISITOR& visitor, TYPE const& defaultValue); ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-028.adoc[_» more..._]# Apply the specified `visitor` to this variant by passing the value (of template parameter `TYPE`) this variant currently holds to the `visitor` object's `operator()`, and return the value (of template parameter `RET_TYPE`) returned by the `visitor`. 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`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class RET_TYPE, class VISITOR, class TYPE> RET_TYPE xref:BloombergLP/bdlb/VariantImp/apply-0e3.adoc[apply]( VISITOR& visitor, TYPE const& defaultValue) const; ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-0e3.adoc[_» more..._]# Same as the preceding overload, but for a `const` visitor. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class RET_TYPE, class VISITOR, class TYPE> RET_TYPE xref:BloombergLP/bdlb/VariantImp/apply-0fc.adoc[apply]( VISITOR const& visitor, TYPE const& defaultValue); ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-0fc.adoc[_» more..._]# Apply the specified `visitor` to this variant by passing the value (of template parameter `TYPE`) this variant currently holds to the `visitor` object's `operator()`, and return the value (of template parameter `RET_TYPE`) returned by the `visitor`. 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`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class RET_TYPE, class VISITOR, class TYPE> RET_TYPE xref:BloombergLP/bdlb/VariantImp/apply-03c.adoc[apply]( VISITOR const& visitor, TYPE const& defaultValue) const; ---- [.small]#xref:BloombergLP/bdlb/VariantImp/apply-03c.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#