From 519f972fc49ad936f022c9daf01b48f89ec8552e Mon Sep 17 00:00:00 2001 From: Alex Fishgait Date: Tue, 10 Oct 2023 09:32:57 +0200 Subject: [PATCH] include memory --- include/nlohmann/detail/input/binary_reader.hpp | 1 + include/nlohmann/detail/input/json_sax.hpp | 1 + include/nlohmann/detail/input/lexer.hpp | 1 + tests/src/unit-allocator.cpp | 8 ++++---- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/nlohmann/detail/input/binary_reader.hpp b/include/nlohmann/detail/input/binary_reader.hpp index f37f04a72..2f0906705 100644 --- a/include/nlohmann/detail/input/binary_reader.hpp +++ b/include/nlohmann/detail/input/binary_reader.hpp @@ -20,6 +20,7 @@ #include // char_traits, string #include // make_pair, move #include // vector +#include #include #include diff --git a/include/nlohmann/detail/input/json_sax.hpp b/include/nlohmann/detail/input/json_sax.hpp index 7b5ae5687..03fcc19e4 100644 --- a/include/nlohmann/detail/input/json_sax.hpp +++ b/include/nlohmann/detail/input/json_sax.hpp @@ -12,6 +12,7 @@ #include // string #include // move #include // vector +#include #include #include diff --git a/include/nlohmann/detail/input/lexer.hpp b/include/nlohmann/detail/input/lexer.hpp index fda9531b7..be2ae048e 100644 --- a/include/nlohmann/detail/input/lexer.hpp +++ b/include/nlohmann/detail/input/lexer.hpp @@ -17,6 +17,7 @@ #include // char_traits, string #include // move #include // vector +#include #include #include diff --git a/tests/src/unit-allocator.cpp b/tests/src/unit-allocator.cpp index 8f016c89d..e86609103 100644 --- a/tests/src/unit-allocator.cpp +++ b/tests/src/unit-allocator.cpp @@ -288,7 +288,7 @@ struct NAlloc } - virtual ~NAlloc() { } + virtual ~NAlloc() = default; pointer allocate(std::size_t n) { @@ -312,16 +312,16 @@ struct NAlloc } my_allocator alloc; - std::size_t m_alloc_size; + std::size_t m_alloc_size {}; }; using OstringStream = std::basic_ostringstream, NAlloc>; using IstringStream = std::basic_istringstream, NAlloc>; -typedef std::basic_string, NAlloc> RtString; +using RtString = std::basic_string, NAlloc>; -} +} //namespace TEST_CASE("controlled bad_alloc_rt_string") {