danielaparker / jsoncons

A C++, header-only library for constructing JSON and JSON-like data formats, with JSON Pointer, JSON Patch, JSON Schema, JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON
https://danielaparker.github.io/jsoncons
Other
726 stars 164 forks source link

fix include error in g++ 4.8 #373

Closed hongweipeng closed 2 years ago

hongweipeng commented 2 years ago

20220609103605

danielaparker commented 2 years ago

We have test coverage for gcc 4.8, but for 4.8.5. There were a lot of gcc bugs fixed between 4.8.1 and 4.8.5.

Does your code still compile with gcc 4.8.2 if you change

int_type overflow( int_type ch = std::streambuf::traits_type::eof() ) override
{
    return ch;
}

to

 int_type overflow( int_type ch = typename std::basic_streambuf<CharT>::traits_type::eof() ) override
 {
        return ch;
 }

?

hongweipeng commented 2 years ago

After the change, it can be compiled.

hongweipeng commented 2 years ago

Oh sorry, didn't notice that your change is different from the one in the PR. I'll try it tomorrow to see if your changes compile.

hongweipeng commented 2 years ago

It can be compile in gcc 4.8.2 when using typename std::basic_streambuf<CharT>::traits_type::eof() .

danielaparker commented 2 years ago

Okay, if you update your pull request to that, I'll accept it.