Skip to content

Fixes N5014 warning#92

Merged
owent merged 1 commit into
mainfrom
dev
May 27, 2026
Merged

Fixes N5014 warning#92
owent merged 1 commit into
mainfrom
dev

Conversation

@owent

@owent owent commented May 27, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings May 27, 2026 07:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors include/memory/allocator_traits.h to fix MSVC warning N5014 by replacing the previously‑exposed memory::allocator_traits<Alloc> helper (which users were expected to inject as a specialization of std::allocator_traits) with a new CRTP-style memory::allocator_adapter<Allocator, T, BackendAllocator> base class. Custom allocators now inherit from allocator_adapter and let the primary std::allocator_traits template detect the inherited nested types and members, avoiding the previously fragile/forbidden specialization of standard-library templates. The test allocator in wal_object_test.cpp is migrated to this new pattern.

Changes:

  • Removed the SFINAE-heavy memory::allocator_traits<Alloc> helper plus all detection macros, and introduced allocator_adapter (with is_always_equal/backend-equal helpers and operator==/operator!=).
  • Updated the example/header documentation to describe the new adapter-based usage and explicitly warn against specializing std::allocator_traits.
  • Migrated test_wal_object_test_allocator in the WAL test to inherit from allocator_adapter and removed the previous std::allocator_traits specialization block.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
include/memory/allocator_traits.h Replaces the old traits helper with a CRTP allocator_adapter and updates header docs/pragmas.
test/case/wal_object_test.cpp Updates the test allocator to use allocator_adapter and drops the std::allocator_traits specialization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@owent owent merged commit f82ed7b into main May 27, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants