refactor(result): split large result.h into modular sub-headers#246
Merged
Conversation
Split 913-line result.h into focused sub-headers under result/ directory to improve compilation times and maintainability: - result/fwd.h: Forward declarations and result_state enum - result/error_info.h: error_info struct and error_code alias - result/result_core.h: Result<T> class definition - result/optional.h: Optional<T> class - result/result_funcs.h: Factory and helper functions - result/error_codes_compat.h: Backward compatibility aliases - result/exception_conversion.h: try_catch utilities - result/result_macros.h: Convenience macros result.h becomes an umbrella header that includes all sub-headers, maintaining full backward compatibility with existing code. Closes #243
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
Split 913-line result.h into focused sub-headers under result/ directory to improve compilation times and maintainability: - result/fwd.h: Forward declarations and result_state enum - result/error_info.h: error_info struct and error_code alias - result/result_core.h: Result<T> class definition - result/optional.h: Optional<T> class - result/result_funcs.h: Factory and helper functions - result/error_codes_compat.h: Backward compatibility aliases - result/exception_conversion.h: try_catch utilities - result/result_macros.h: Convenience macros result.h becomes an umbrella header that includes all sub-headers, maintaining full backward compatibility with existing code. Closes #243
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
result.hinto 8 focused sub-headers underresult/directoryresult.hto umbrella header for full backward compatibilityChanges
New Header Structure
Documentation Updates
BEST_PRACTICES.mdwith new header structure and include strategiesCHANGELOG.mdwith change descriptionBenefits
#include <.../result.h>unchangedTest Plan
Closes #243