[#BloombergLP-bdlar-AnyCastUtil-toAnyRef-09]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlar.adoc[bdlar]::xref:BloombergLP/bdlar/AnyCastUtil.adoc[AnyCastUtil]::toAnyRef
:relfileprefix: ../../../
:mrdocs:

`toAnyRef` overloads

== Synopses

Declared in `&lt;bdlar&lowbar;anycastutil&period;h&gt;`

Return an `AnyRef` referring to the same array as `ref`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdlar/AnyRef.adoc[AnyRef]
xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-02c.adoc[toAnyRef](xref:BloombergLP/bdlar/ArrayRef.adoc[ArrayRef] const& ref);
----

[.small]#xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-02c.adoc[_» more&period;&period;&period;_]#

Return an `AnyRef` referring to the same choice as `ref`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdlar/AnyRef.adoc[AnyRef]
xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-05.adoc[toAnyRef](xref:BloombergLP/bdlar/ChoiceRef.adoc[ChoiceRef] const& ref);
----

[.small]#xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-05.adoc[_» more&period;&period;&period;_]#

Cast the specified `ref` to `AnyRef`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdlar/AnyRef.adoc[AnyRef]
xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-04.adoc[toAnyRef](xref:BloombergLP/bdlar/CustomizedTypeRef.adoc[CustomizedTypeRef] const& ref);
----

[.small]#xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-04.adoc[_» more&period;&period;&period;_]#

Cast the specified `ref` to `AnyRef`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdlar/AnyRef.adoc[AnyRef]
xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-0d.adoc[toAnyRef](xref:BloombergLP/bdlar/DynamicTypeRef.adoc[DynamicTypeRef] const& ref);
----

[.small]#xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-0d.adoc[_» more&period;&period;&period;_]#

Cast the specified `ref` to `AnyRef`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdlar/AnyRef.adoc[AnyRef]
xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-0b.adoc[toAnyRef](xref:BloombergLP/bdlar/EnumRef.adoc[EnumRef] const& ref);
----

[.small]#xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-0b.adoc[_» more&period;&period;&period;_]#

Cast the specified `ref` to `AnyRef`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdlar/AnyRef.adoc[AnyRef]
xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-0c.adoc[toAnyRef](xref:BloombergLP/bdlar/NullableValueRef.adoc[NullableValueRef] const& ref);
----

[.small]#xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-0c.adoc[_» more&period;&period;&period;_]#

Cast the specified `ref` to `AnyRef`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdlar/AnyRef.adoc[AnyRef]
xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-06.adoc[toAnyRef](xref:BloombergLP/bdlar/SequenceRef.adoc[SequenceRef] const& ref);
----

[.small]#xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-06.adoc[_» more&period;&period;&period;_]#

Cast the specified `ref` to `AnyRef`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bdlar/AnyRef.adoc[AnyRef]
xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-02b.adoc[toAnyRef](xref:BloombergLP/bdlar/SimpleTypeRef.adoc[SimpleTypeRef] const& ref);
----

[.small]#xref:BloombergLP/bdlar/AnyCastUtil/toAnyRef-02b.adoc[_» more&period;&period;&period;_]#

== Return Value

* an `AnyRef` for the array referred to by `ref`
* an `AnyRef` for the choice referred to by `ref`
* an `AnyRef` for the customized type referred to by `ref`
* an `AnyRef` for the dynamic type referred to by `ref`
* an `AnyRef` for the enumeration referred to by `ref`
* an `AnyRef` for the nullable value referred to by `ref`
* an `AnyRef` for the sequence referred to by `ref`
* an `AnyRef` for the simple type referred to by `ref`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ref*
| array reference to wrap as `AnyRef`
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
