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);
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.