[#BloombergLP-balcl-CommandLine-hasValue]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balcl.adoc[balcl]::xref:BloombergLP/balcl/CommandLine.adoc[CommandLine]::hasValue
:relfileprefix: ../../../
:mrdocs:

Return `true` if the option having `name` has a defined value&period;

== Synopsis

Declared in `&lt;balcl&lowbar;commandline&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
hasValue(std::string&lowbar;view const& name) const;
----

== Description

An option has a defined value if `isSpecified(name)` or if a default value was configured for the option (see &lcub;Occurrence Information Field&rcub;)&period; The behavior is undefined unless this command&hyphen;line object `isParsed()` and `hasOption(name)`&period;

== Return Value

`true` if the named option has a defined value, and `false` otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *name*
| option name to query
|===


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