2121#include < nlohmann/detail/input/input_adapters.hpp>
2222#include < nlohmann/detail/input/position_t.hpp>
2323#include < nlohmann/detail/macro_scope.hpp>
24+ #include < nlohmann/detail/meta/type_traits.hpp>
2425
2526NLOHMANN_JSON_NAMESPACE_BEGIN
2627namespace detail
@@ -115,7 +116,7 @@ class lexer : public lexer_base<BasicJsonType>
115116 using number_float_t = typename BasicJsonType::number_float_t ;
116117 using string_t = typename BasicJsonType::string_t ;
117118 using char_type = typename InputAdapterType::char_type;
118- using char_int_type = typename std:: char_traits<char_type>::int_type;
119+ using char_int_type = typename char_traits<char_type>::int_type;
119120
120121 public:
121122 using token_type = typename lexer_base<BasicJsonType>::token_type;
@@ -265,7 +266,7 @@ class lexer : public lexer_base<BasicJsonType>
265266 switch (get ())
266267 {
267268 // end of file while parsing string
268- case std:: char_traits<char_type>::eof ():
269+ case char_traits<char_type>::eof ():
269270 {
270271 error_message = " invalid string: missing closing quote" ;
271272 return token_type::parse_error;
@@ -854,7 +855,7 @@ class lexer : public lexer_base<BasicJsonType>
854855 {
855856 case ' \n ' :
856857 case ' \r ' :
857- case std:: char_traits<char_type>::eof ():
858+ case char_traits<char_type>::eof ():
858859 case ' \0 ' :
859860 return true ;
860861
@@ -871,7 +872,7 @@ class lexer : public lexer_base<BasicJsonType>
871872 {
872873 switch (get ())
873874 {
874- case std:: char_traits<char_type>::eof ():
875+ case char_traits<char_type>::eof ():
875876 case ' \0 ' :
876877 {
877878 error_message = " invalid comment; missing closing '*/'" ;
@@ -1300,10 +1301,10 @@ class lexer : public lexer_base<BasicJsonType>
13001301 token_type scan_literal (const char_type* literal_text, const std::size_t length,
13011302 token_type return_type)
13021303 {
1303- JSON_ASSERT (std:: char_traits<char_type>::to_char_type (current) == literal_text[0 ]);
1304+ JSON_ASSERT (char_traits<char_type>::to_char_type (current) == literal_text[0 ]);
13041305 for (std::size_t i = 1 ; i < length; ++i)
13051306 {
1306- if (JSON_HEDLEY_UNLIKELY (std:: char_traits<char_type>::to_char_type (get ()) != literal_text[i]))
1307+ if (JSON_HEDLEY_UNLIKELY (char_traits<char_type>::to_char_type (get ()) != literal_text[i]))
13071308 {
13081309 error_message = " invalid literal" ;
13091310 return token_type::parse_error;
@@ -1321,15 +1322,15 @@ class lexer : public lexer_base<BasicJsonType>
13211322 {
13221323 token_buffer.clear ();
13231324 token_string.clear ();
1324- token_string.push_back (std:: char_traits<char_type>::to_char_type (current));
1325+ token_string.push_back (char_traits<char_type>::to_char_type (current));
13251326 }
13261327
13271328 /*
13281329 @brief get next character from the input
13291330
13301331 This function provides the interface to the used input adapter. It does
13311332 not throw in case the input reached EOF, but returns a
1332- `std:: char_traits<char>::eof()` in that case. Stores the scanned characters
1333+ `char_traits<char>::eof()` in that case. Stores the scanned characters
13331334 for use in error messages.
13341335
13351336 @return character read from the input
@@ -1349,9 +1350,9 @@ class lexer : public lexer_base<BasicJsonType>
13491350 current = ia.get_character ();
13501351 }
13511352
1352- if (JSON_HEDLEY_LIKELY (current != std:: char_traits<char_type>::eof ()))
1353+ if (JSON_HEDLEY_LIKELY (current != char_traits<char_type>::eof ()))
13531354 {
1354- token_string.push_back (std:: char_traits<char_type>::to_char_type (current));
1355+ token_string.push_back (char_traits<char_type>::to_char_type (current));
13551356 }
13561357
13571358 if (current == ' \n ' )
@@ -1390,7 +1391,7 @@ class lexer : public lexer_base<BasicJsonType>
13901391 --position.chars_read_current_line ;
13911392 }
13921393
1393- if (JSON_HEDLEY_LIKELY (current != std:: char_traits<char_type>::eof ()))
1394+ if (JSON_HEDLEY_LIKELY (current != char_traits<char_type>::eof ()))
13941395 {
13951396 JSON_ASSERT (!token_string.empty ());
13961397 token_string.pop_back ();
@@ -1584,7 +1585,7 @@ class lexer : public lexer_base<BasicJsonType>
15841585 // end of input (the null byte is needed when parsing from
15851586 // string literals)
15861587 case ' \0 ' :
1587- case std:: char_traits<char_type>::eof ():
1588+ case char_traits<char_type>::eof ():
15881589 return token_type::end_of_input;
15891590
15901591 // error
@@ -1602,7 +1603,7 @@ class lexer : public lexer_base<BasicJsonType>
16021603 const bool ignore_comments = false ;
16031604
16041605 // / the current character
1605- char_int_type current = std:: char_traits<char_type>::eof();
1606+ char_int_type current = char_traits<char_type>::eof();
16061607
16071608 // / whether the next get() call should just return current
16081609 bool next_unget = false ;
0 commit comments