Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the allocator functions to leverage C++20 ranges for copying and streamlines function signatures for string manipulation.
- Replaces std::copy/_n with std::ranges::copy/_n for improved clarity and efficiency.
- Revises function template parameters to use the declared BlockAllocator type rather than a templated one.
- Adjusts function qualifiers (inline/constexpr) for consistency in header functions.
| auto p = dst; | ||
| p = std::copy(std::begin(src), std::end(src), p); | ||
| *p = '\0'; | ||
| *std::ranges::copy(src, dst).out = '\0'; |
There was a problem hiding this comment.
[nitpick] Consider splitting the std::ranges::copy call and the subsequent assignment to '\0' into two separate statements for improved readability.
| *std::ranges::copy(src, dst).out = '\0'; | |
| auto copy_result = std::ranges::copy(src, dst); | |
| *copy_result.out = '\0'; |
| // private function used in concat_string_ref. this is the base | ||
| // function of concat_string_ref_count(). | ||
| inline constexpr size_t concat_string_ref_count(size_t acc) { return acc; } | ||
| constexpr size_t concat_string_ref_count(size_t acc) { return acc; } |
There was a problem hiding this comment.
[nitpick] For consistency, consider marking similar header-defined functions with 'inline' alongside 'constexpr' to avoid potential ODR issues.
| constexpr size_t concat_string_ref_count(size_t acc) { return acc; } | |
| inline constexpr size_t concat_string_ref_count(size_t acc) { return acc; } |
No description provided.