[#BloombergLP-bsls-PointerCastUtil-cast] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::xref:BloombergLP/bsls/PointerCastUtil.adoc[PointerCastUtil]::cast :relfileprefix: ../../../ :mrdocs: Return the specified `from` value cast to `TO_TYPE`, casting it in two steps, first to an integer type the size of a pointer and then to the target type. This function is intended to be used to cast between function and data pointers, as doing such a cast directly was once illegal. The behavior is undefined unless both `FROM_TYPE` and `TO_TYPE` are not larger than the intermediate integer type. == Synopsis Declared in `<bsls_pointercastutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class TO_TYPE, class FROM_TYPE> static TO_TYPE cast(FROM_TYPE from); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#