[#BloombergLP-baljsn-EncodeImplUtil-validateChoice]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/baljsn.adoc[baljsn]::xref:BloombergLP/baljsn/EncodeImplUtil.adoc[EncodeImplUtil]::validateChoice
:relfileprefix: ../../../
:mrdocs:

Determine whether the choice `value` has a defined selection&period;

== Synopsis

Declared in `&lt;baljsn&lowbar;encodeimplutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
static
int
validateChoice(
    std::ostream* logStream,
    TYPE const& value);
----

== Description

Determine if the specified `value` satisfies the requirements for encoding using this component&period; If the `value` meets the encoding requirements, return 0, otherwise load an unspecified, human&hyphen;readable description of the requirements that are not satisfied by the `value` to the specified `logStream` and return a non&hyphen;zero value&period; The `value` is required to not have an undefined `selectionId`&period;

== Return Value

0 if valid, and a non&hyphen;zero value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *logStream*
| stream for human&hyphen;readable error descriptions
| *value*
| choice value to validate
|===


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