Skip to content

Commit df5836c

Browse files
committed
♻️ replace EOF with char_traits #2755
1 parent 7843473 commit df5836c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

include/nlohmann/detail/meta/type_traits.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#pragma once
1010

1111
#include <limits> // numeric_limits
12+
#include <string> // char_traits
13+
#include <tuple> // tuple
1214
#include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type
1315
#include <utility> // declval
14-
#include <tuple> // tuple
15-
#include <string> // char_traits
1616

1717
#include <nlohmann/detail/iterators/iterator_traits.hpp>
1818
#include <nlohmann/detail/macro_scope.hpp>
@@ -211,7 +211,7 @@ struct char_traits<unsigned char> : std::char_traits<char>
211211

212212
static constexpr int_type eof() noexcept
213213
{
214-
return static_cast<int_type>(EOF);
214+
return static_cast<int_type>(std::char_traits<char>::eof());
215215
}
216216
};
217217

@@ -235,7 +235,7 @@ struct char_traits<signed char> : std::char_traits<char>
235235

236236
static constexpr int_type eof() noexcept
237237
{
238-
return static_cast<int_type>(EOF);
238+
return static_cast<int_type>(std::char_traits<char>::eof());
239239
}
240240
};
241241

single_include/nlohmann/json.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3273,10 +3273,10 @@ NLOHMANN_JSON_NAMESPACE_END
32733273

32743274

32753275
#include <limits> // numeric_limits
3276+
#include <string> // char_traits
3277+
#include <tuple> // tuple
32763278
#include <type_traits> // false_type, is_constructible, is_integral, is_same, true_type
32773279
#include <utility> // declval
3278-
#include <tuple> // tuple
3279-
#include <string> // char_traits
32803280

32813281
// #include <nlohmann/detail/iterators/iterator_traits.hpp>
32823282
// __ _____ _____ _____
@@ -3658,7 +3658,7 @@ struct char_traits<unsigned char> : std::char_traits<char>
36583658

36593659
static constexpr int_type eof() noexcept
36603660
{
3661-
return static_cast<int_type>(EOF);
3661+
return static_cast<int_type>(std::char_traits<char>::eof());
36623662
}
36633663
};
36643664

@@ -3682,7 +3682,7 @@ struct char_traits<signed char> : std::char_traits<char>
36823682

36833683
static constexpr int_type eof() noexcept
36843684
{
3685-
return static_cast<int_type>(EOF);
3685+
return static_cast<int_type>(std::char_traits<char>::eof());
36863686
}
36873687
};
36883688

0 commit comments

Comments
 (0)