You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the opening curly braces '{' is read as a char, newlines and spaces set the state "failbit".
This can be an issue for serializing containers in a struct, which usually require the size to be read and then the sequence.
It would be silly to pollute users serialization functions for containers with the curly braces.
Therefore, I changed my local copy of io_fields to read:
char parenthis = {}; // That is in the original.
do
{
in >> parenthis;
}
while(parenthis=='\n'||parenthis==' ');
if (parenthis != '{') in.setstate(std::basic_istream<Char, Traits>::failbit);
Will think about a better solution later.
The text was updated successfully, but these errors were encountered:
Since the opening curly braces '{' is read as a char, newlines and spaces set the state "failbit".
This can be an issue for serializing containers in a struct, which usually require the size to be read and then the sequence.
It would be silly to pollute users serialization functions for containers with the curly braces.
Therefore, I changed my local copy of io_fields to read:
char parenthis = {}; // That is in the original.
do
{
in >> parenthis;
}
while(parenthis=='\n'||parenthis==' ');
if (parenthis != '{') in.setstate(std::basic_istream<Char, Traits>::failbit);
Will think about a better solution later.
The text was updated successfully, but these errors were encountered: