I came across this code.
std::ostringstream str; /// (some usage) assert( ! str );
What does it mean when used in context ? ostringstream bool
ostringstream
bool
Perhaps this is a misuse that happens to compile and run?
It tells you if the stream is really valid. This is what all threads can do. For example, a file stream may be invalid if the file was not opened properly.
( bool) explicit operator bool ++ 11 void* ++ 11.
explicit operator bool
void*
, , . , .
: bool void* , .
: ostringstream:: operator void *() ostringstream:: !().
. :
istringstream is; is.str( "foo" ); int x; is >> x; if ( ! is ) { cerr << "Conversion failed"; }
I'm not sure that any of the standard streaming functions can cause ostringstream to work poorly, but you can certainly write them yourself.
Source: https://habr.com/ru/post/1707877/More articles:GetListItems Webservice игнорирует мой фильтр запросов - jqueryIs it possible to create an empty java string from a non-empty UTF-8 byte array? - javaMake sure the reader is c #Entering an XML column using log4net - xmlThe least annoying email format - emailКакая хорошая практика для разделения презентаторов в шаблоне интерфейса MVP, который стал слишком большим? - user-interfaceHow can I configure the Nib load of my subclass of UIScrollView? - iphoneVisual Studio 2005 will not compile in Release Configuration mode - asp.netWhich API provides Linux wireless notifications? - linuxMultiproc builds in VS2008 - build-processAll Articles