Unverified Commit b69713c3 authored by Niels Lohmann's avatar Niels Lohmann Committed by GitHub

Fix compilation error with NVCC (#3234)

parent 926df56d
...@@ -23,10 +23,10 @@ template <class Key, class T, class IgnoredLess = std::less<Key>, ...@@ -23,10 +23,10 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
using key_type = Key; using key_type = Key;
using mapped_type = T; using mapped_type = T;
using Container = std::vector<std::pair<const Key, T>, Allocator>; using Container = std::vector<std::pair<const Key, T>, Allocator>;
using typename Container::iterator; using iterator = typename Container::iterator;
using typename Container::const_iterator; using const_iterator = typename Container::const_iterator;
using typename Container::size_type; using size_type = typename Container::size_type;
using typename Container::value_type; using value_type = typename Container::value_type;
// Explicit constructors instead of `using Container::Container` // Explicit constructors instead of `using Container::Container`
// otherwise older compilers choke on it (GCC <= 5.5, xcode <= 9.4) // otherwise older compilers choke on it (GCC <= 5.5, xcode <= 9.4)
......
...@@ -17041,10 +17041,10 @@ template <class Key, class T, class IgnoredLess = std::less<Key>, ...@@ -17041,10 +17041,10 @@ template <class Key, class T, class IgnoredLess = std::less<Key>,
using key_type = Key; using key_type = Key;
using mapped_type = T; using mapped_type = T;
using Container = std::vector<std::pair<const Key, T>, Allocator>; using Container = std::vector<std::pair<const Key, T>, Allocator>;
using typename Container::iterator; using iterator = typename Container::iterator;
using typename Container::const_iterator; using const_iterator = typename Container::const_iterator;
using typename Container::size_type; using size_type = typename Container::size_type;
using typename Container::value_type; using value_type = typename Container::value_type;
// Explicit constructors instead of `using Container::Container` // Explicit constructors instead of `using Container::Container`
// otherwise older compilers choke on it (GCC <= 5.5, xcode <= 9.4) // otherwise older compilers choke on it (GCC <= 5.5, xcode <= 9.4)
......
...@@ -4,4 +4,8 @@ int main() ...@@ -4,4 +4,8 @@ int main()
{ {
nlohmann::ordered_json json = {"Test"}; nlohmann::ordered_json json = {"Test"};
json.dump(); json.dump();
// regression for #3013 (ordered_json::reset() compile error with nvcc)
nlohmann::ordered_json metadata;
metadata.erase("key");
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment