[#BloombergLP-bslx-InStreamFunctions-bdexStreamIn-0c6]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslx.adoc[bslx]::xref:BloombergLP/bslx/InStreamFunctions.adoc[InStreamFunctions]::bdexStreamIn
:relfileprefix: ../../../
:mrdocs:

BDEX&hyphen;stream `variable` from `stream` (version computed if needed)&period;

== Synopsis

Declared in `&lt;bslx&lowbar;instreamfunctions&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class STREAM,
    class VALUE&lowbar;TYPE&gt;
STREAM&
bdexStreamIn(
    STREAM& stream,
    VALUE&lowbar;TYPE& variable);
----

== Description

Assign to the specified `variable` the `VALUE&lowbar;TYPE` value read from the specified input `stream`, and return a reference to `stream`&period; If `stream` is initially invalid, this operation has no effect&period; If needed, first read the version information from the `stream` and if this version is not supported by `VALUE&lowbar;TYPE`, `stream` is invalidated, but otherwise unmodified&period; If `stream` becomes invalid during this operation, `variable` has an undefined, but valid, state&period; Note that the version is only needed when the (template parameter) `VALUE&lowbar;TYPE` is a `bsl&colon;&colon;vector` or a user&hyphen;defined type&period; See the `bslx` package&hyphen;level documentation for more information on BDEX streaming of value&hyphen;semantic types and containers&period;

== Return Value

a reference to `stream`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *stream*
| input stream from which to read
| *variable*
| object to receive the unexternalized value
|===


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