Repository navigation
Rename PascalCase entities to std-style snake_case (#96) - #248
Conversation
CETL is meant to read like the standard library, and #85 settled that it uses std's snake_case naming; newer types (optional, variant, rtti, unbounded_variant, pmr::function) already do. This renames the older PascalCase types to match. Public types that users can name keep their old names as [[deprecated]] aliases next to the new definitions, so existing code keeps compiling with a warning that names the replacement: VariableLengthArray -> variable_length_array UnsynchronizedArrayMemoryResource -> unsynchronized_array_memory_resource UnsynchronizedBufferMemoryResource -> unsynchronized_buffer_memory_resource deviant::MaxAlignNewDeleteResource -> deviant::max_align_new_delete_resource UnsynchronizedBufferMemoryResourceDelegate -> unsynchronized_buffer_memory_resource_delegate O1HeapAlignedStorage -> o1heap_aligned_storage UnsynchronizedO1HeapMemoryResourceDelegate -> unsynchronized_o1heap_memory_resource_delegate MemoryResourceDeleter -> memory_resource_deleter PolymorphicDeleter -> polymorphic_deleter Factory -> factory PmrInterfaceDeleter -> pmr_interface_deleter InterfacePtr -> interface_ptr InterfaceFactory -> interface_factory Private members, detail-namespace helpers and class-local type aliases are renamed without aliases since users cannot name them. All uses in CETLVaSt (tests, examples, fuzz and MCU suites) move to the new names; test_deprecated_names.cpp checks every alias still names the same type. CONTRIBUTING.md gains a "Naming Conventions" section describing the style and the rename-with-deprecated-alias policy. Closes #96. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 868610da9f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
MAMONTBOT
left a comment
There was a problem hiding this comment.
Reviewed the changes; no blocking issues found.
UnsynchronizedBufferMemoryResourceDelegate, MemoryResourceDeleter and
PolymorphicDeleter could deduce their template argument from a
constructor call while they were class templates. As alias templates
they only can from C++20 (P1814), so C++17 code such as
`MemoryResourceDeleter d{res, size};` no longer compiles through the
old name. No C++17 construct keeps both deduction and type identity, so
this is a known break of the rename, like the mangled-name change, and
ships with the same major release.
Note it on the three aliases and in CONTRIBUTING's rename policy, and
add a C++20-only test that deduction through the old names works there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18818b6
Summary
Closes #96. As settled in #85, CETL follows the standard library's snake_case naming. This PR renames the remaining PascalCase entities and keeps the old public names working as
[[deprecated]]aliases.Public names (each old name kept as a deprecated alias):
cetl::VariableLengthArraycetl::variable_length_arraycetl::pf17::pmr::UnsynchronizedArrayMemoryResourceunsynchronized_array_memory_resourcecetl::pf17::pmr::UnsynchronizedBufferMemoryResourceunsynchronized_buffer_memory_resourcecetl::pf17::pmr::deviant::MaxAlignNewDeleteResourcemax_align_new_delete_resourcecetl::pmr::UnsynchronizedBufferMemoryResourceDelegateunsynchronized_buffer_memory_resource_delegatecetl::pmr::O1HeapAlignedStorageo1heap_aligned_storagecetl::pmr::UnsynchronizedO1HeapMemoryResourceDelegateunsynchronized_o1heap_memory_resource_delegatecetl::pmr::MemoryResourceDeletermemory_resource_deletercetl::pmr::PolymorphicDeleterpolymorphic_deletercetl::pmr::Factoryfactorycetl::pmr::PmrInterfaceDeleterpmr_interface_deletercetl::pmr::InterfacePtrinterface_ptrcetl::pmr::InterfaceFactoryinterface_factoryInternal names (renamed with no alias, since users can't name them):
detail::helpers:SynthThreeWay,VariableLengthArrayBase,IsPmr,EnableIfPmrT,EnableIfNotPmrTIteratorImpl,MemoryResourceData,ConcreteRaii,IsCallable,EnableIfLvIsCallable,EnableIfNotPair,BufferControl,ValueConstPtrAndTypeId,IsMovableT,swapVariants()Base,Storage,Concrete,RawValueType,ReturnTypeTemplate parameters stay PascalCase, matching the newer headers.
Other changes:
UnsynchronizedBArrayMemoryResource/PolymorphicAllocatorDeleter, and one comment namedstd::pmr::where it meantcetl::pmr::; those are fixed too.CONTRIBUTING.mdhas a new "Naming Conventions" section. It describes the style and the rename policy: rename, keep a deprecated alias, and remove the alias only in a major release.CETL_VERSION_MINORis left alone. Earlier feature PRs haven't bumped it, so I've assumed it's bumped at release time.Tests
test_deprecated_names.cpp:static_asserts that each of the 13 aliases names the same type as its replacement, including thevariable_length_array<bool>specializationFactoryandInterfaceFactorythrough their old namesValidation
build,run_unittestsandrun_examplesall pass.configure-gcc7-native-cpp-14-offline), Debug / DebugEP:build,run_unittestsandrun_examplesall pass.mcu/test_text.cpppass a syntax check. Doxygen gives no warnings about any renamed name.🤖 Generated with Claude Code