[#bsl-basic_istringstream-sync-07]
= xref:bsl.adoc[bsl]::xref:bsl/basic_istringstream.adoc[basic&lowbar;istringstream]::sync
:relfileprefix: ../../
:mrdocs:

Synchronizing the stream buffer&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
sync();
----

== Description

If `rdbuf()` is a null pointer, returns &hyphen;1&period;

Otherwise, calls `rdbuf()&hyphen;&gt;pubsync(),` and if that returns &hyphen;1, sets badbit and returns &hyphen;1&period;

Otherwise, returns 0&period;

[NOTE]
====
This function does not count the number of characters extracted, if any, and therefore does not affect the next call to `gcount()&period;`

====

== Return Value

0 on success, &hyphen;1 on failure


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