Skip to content

Commit

Permalink
🚨 fix shadowing warning
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Dec 15, 2020
1 parent 2fc1f69 commit 5cc5285
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -923,14 +923,14 @@ class basic_json
AllocatorType<T> alloc;
using AllocatorTraits = std::allocator_traits<AllocatorType<T>>;

auto deleter = [&](T * object)
auto deleter = [&](T * obj)
{
AllocatorTraits::deallocate(alloc, object, 1);
AllocatorTraits::deallocate(alloc, obj, 1);
};
std::unique_ptr<T, decltype(deleter)> object(AllocatorTraits::allocate(alloc, 1), deleter);
AllocatorTraits::construct(alloc, object.get(), std::forward<Args>(args)...);
JSON_ASSERT(object != nullptr);
return object.release();
std::unique_ptr<T, decltype(deleter)> obj(AllocatorTraits::allocate(alloc, 1), deleter);
AllocatorTraits::construct(alloc, obj.get(), std::forward<Args>(args)...);
JSON_ASSERT(obj != nullptr);
return obj.release();
}

////////////////////////
Expand Down
12 changes: 6 additions & 6 deletions single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17495,14 +17495,14 @@ class basic_json
AllocatorType<T> alloc;
using AllocatorTraits = std::allocator_traits<AllocatorType<T>>;

auto deleter = [&](T * object)
auto deleter = [&](T * obj)
{
AllocatorTraits::deallocate(alloc, object, 1);
AllocatorTraits::deallocate(alloc, obj, 1);
};
std::unique_ptr<T, decltype(deleter)> object(AllocatorTraits::allocate(alloc, 1), deleter);
AllocatorTraits::construct(alloc, object.get(), std::forward<Args>(args)...);
JSON_ASSERT(object != nullptr);
return object.release();
std::unique_ptr<T, decltype(deleter)> obj(AllocatorTraits::allocate(alloc, 1), deleter);
AllocatorTraits::construct(alloc, obj.get(), std::forward<Args>(args)...);
JSON_ASSERT(obj != nullptr);
return obj.release();
}

////////////////////////
Expand Down

0 comments on commit 5cc5285

Please sign in to comment.