std::istream/std::streambuf use std::char_traits ::to_int_type, to ensure that std::char_traits ::eof() and the character 0xFF do not end up as the same value, e.g. 0xFFFFFFFF.
| 6185 | // ensure that std::char_traits<char>::eof() and the character 0xFF do not |
| 6186 | // end up as the same value, e.g. 0xFFFFFFFF. |
| 6187 | std::char_traits<char>::int_type get_character() |
| 6188 | { |
| 6189 | auto res = sb->sbumpc(); |
| 6190 | // set eof manually, as we don't use the istream interface. |
| 6191 | if (JSON_HEDLEY_UNLIKELY(res == std::char_traits<char>::eof())) |
| 6192 | { |
| 6193 | is->clear(is->rdstate() | std::ios::eofbit); |
| 6194 | } |
| 6195 | return res; |
| 6196 | } |
| 6197 | |
| 6198 | private: |
| 6199 | /// the associated input stream |
no outgoing calls
no test coverage detected