Consolidate Result<T> headers for C++20 module preparation#257
Merged
Conversation
Create three new consolidated headers following Kent Beck's "Fewest Elements" principle: - core.h: Combines fwd, error_info, result_core, and optional - utilities.h: Combines result_funcs, exception_conversion, and macros - compat.h: Contains error codes compatibility layer This reduces header count from 9 to 3 logical files, preparing for future C++20 module migration. Refs: #255
Update result.h to include new consolidated headers (core.h, utilities.h, compat.h) instead of individual headers. This maintains backward compatibility while simplifying the include structure. Refs: #255
Add deprecation warnings to old individual headers: - fwd.h -> core.h - error_info.h -> core.h - result_core.h -> core.h - optional.h -> core.h - result_funcs.h -> utilities.h - exception_conversion.h -> utilities.h - result_macros.h -> utilities.h - error_codes_compat.h -> compat.h Headers still work but emit compiler warnings directing users to the new consolidated headers. Original content preserved for reference within #if 0 blocks. Refs: #255
Replace deprecated fwd.h include with core.h in callable.h to eliminate deprecation warnings. Refs: #255
Update DEPRECATION.md with: - New section for deprecated individual Result headers - Migration guide from 8 headers to 3 consolidated headers - Future C++20 module structure information Update CHANGELOG.md with: - Consolidated headers change entry - Deprecation section for individual headers Refs: #255
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
* feat(result): add consolidated headers for C++20 module preparation Create three new consolidated headers following Kent Beck's "Fewest Elements" principle: - core.h: Combines fwd, error_info, result_core, and optional - utilities.h: Combines result_funcs, exception_conversion, and macros - compat.h: Contains error codes compatibility layer This reduces header count from 9 to 3 logical files, preparing for future C++20 module migration. Refs: #255 * refactor(result): update umbrella header to use consolidated headers Update result.h to include new consolidated headers (core.h, utilities.h, compat.h) instead of individual headers. This maintains backward compatibility while simplifying the include structure. Refs: #255 * refactor(result): deprecate individual headers with pragma message Add deprecation warnings to old individual headers: - fwd.h -> core.h - error_info.h -> core.h - result_core.h -> core.h - optional.h -> core.h - result_funcs.h -> utilities.h - exception_conversion.h -> utilities.h - result_macros.h -> utilities.h - error_codes_compat.h -> compat.h Headers still work but emit compiler warnings directing users to the new consolidated headers. Original content preserved for reference within #if 0 blocks. Refs: #255 * refactor(concepts): update callable.h to use core.h Replace deprecated fwd.h include with core.h in callable.h to eliminate deprecation warnings. Refs: #255 * docs: add Result<T> header consolidation to documentation Update DEPRECATION.md with: - New section for deprecated individual Result headers - Migration guide from 8 headers to 3 consolidated headers - Future C++20 module structure information Update CHANGELOG.md with: - Consolidated headers change entry - Deprecation section for individual headers Refs: #255
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
New Consolidated Headers
result/core.hresult/utilities.hresult/compat.hDeprecated Headers
Individual headers now emit deprecation warnings:
fwd.h,error_info.h,result_core.h,optional.h->core.hresult_funcs.h,exception_conversion.h,result_macros.h->utilities.herror_codes_compat.h->compat.hMigration Path
Metrics
Test Plan
Documentation
Closes #255