[#BloombergLP-bslma-ManagedPtr-0fa-2conversion-0a]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[ManagedPtr]::operator xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[BoolType]
:relfileprefix: ../../../
:mrdocs:

Return whether this managed pointer is non&hyphen;empty&period;

== Synopsis

Declared in `&lt;bslma&lowbar;managedptr&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[BoolType]() const;
----

== Description

Return a value of &quot;unspecified bool&quot; type that evaluates to `false` if this managed pointer is empty, and `true` otherwise&period; Note that this conversion operator allows a managed pointer to be used within a conditional context, such as within an `if` or `while` statement, but does _not_ allow managed pointers to be compared (e&period;g&period;, via `&lt;` or `&gt;`)&period; Also note that a superior solution is available in C&plus;&plus;11 using the `explicit operator bool()` syntax, that removes the need for a special boolean&hyphen;like type and private equality&hyphen;comparison operators&period;

== Return Value

value that evaluates to `false` if empty, and `true` otherwise


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