Abfrage über Überlauffunktion von streambuf
Frage
Going Thorugh Überlauffunktion Dokumentation. Ich fand Überlauf folgenden als Rückgabewert.
Rückgabewert:
Ein Wert anders als EOF (oder Züge :: EOF () für andere Züge) Signale Erfolg.
Wenn die Funktion fehlschlägt, entweder EOF (oder Züge :: EOF () für andere Züge) zurückgeführt wird oder eine Ausnahme ausgelöst wird.
Quelle: " http://www.cplusplus.com/reference/iostream / streambuf / Überlauf / "
Kann jemand bitte sagen Sie mir, in dem sceanrios wird Überlauffunktion durch eine Ausnahme? Jede Hilfe wird geschätzt werden,
Lösung 3
In my problematic scenario it was faling because it was not jumping the next address(setp calls was incrementating by 0) so retrying to use the same memory region and was giving segmentation fault.
Andere Tipps
Streambuf is abstraction for stream's underlying storage or communication channel. The overflow() function can fail for any reasons the storage or channel can fail. E.g. disk error for disk files, broken connection for sockets etc.
Although wilx detailed the fail (EOF
) condition, the exception condition can be either one of these: http://www.aoc.nrao.edu/php/tjuerges/ALMA/STL/html-3.4.6/classstd_1_1exception.html (can you guess which one? :) -- but it should (obviously) be std::overflow_error
if you're writing your own output stream or something.