[#bsl-shared_ptr-0a-2conversion-05]
= xref:bsl.adoc[bsl]::xref:bsl/shared_ptr-0a.adoc[shared&lowbar;ptr]::operator xref:bsl/shared_ptr-0a.adoc[BoolType]
:relfileprefix: ../../
:mrdocs:

Return a value of an &quot;unspecified bool&quot; type that evaluates to `false` if this shared pointer does not refer to an object, and `true` otherwise&period; Note that this conversion operator allows a shared pointer to be used within a conditional context (e&period;g&period;, within an `if` or `while` statement), but does _not_ allow shared pointers to unrelated types to be compared (e&period;g&period;, via `&lt;` or `&gt;`)&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;sharedptr&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
operator xref:bsl/shared_ptr-0a.adoc[BoolType]() const noexcept;
----


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