Fix MSVC 2015 failures on AppVeyor

- object_capacity() (#5832) overloaded a static with a non-static member
  function template, which MSVC 2015 rejects (C2686); make all three
  overloads non-static.
- The JSON pointer hash constants (#5836) truncate on 32-bit size_t
  (C4309 with /WX); mask them to size_t's range before the cast.
- unit-diagnostics: MSVC 2015 cannot use-declare the base's Container
  typedef (C2886); use alias declarations instead.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-16 08:31:07 +02:00
1 parent ac17aad589
commit e5b8f453e5
4 files changed
+10 -10

No files matched your search

+2 -2
View File
@@ -817,8 +817,8 @@ template<class Key, class T, class IgnoredLess = std::less<Key>,
struct relocating_map : nlohmann::ordered_map<Key, T, IgnoredLess, Allocator>
{
using base_type = nlohmann::ordered_map<Key, T, IgnoredLess, Allocator>;
using typename base_type::iterator;
using typename base_type::Container;
using iterator = typename base_type::iterator;
using Container = typename base_type::Container;
using base_type::base_type;
template<typename... Args>