Forward declare tuple_size/tuple_element and raw_json, move custom into forward.hpp - #2613
Open
stephenberry wants to merge 1 commit into
Open
Forward declare tuple_size/tuple_element and raw_json, move custom into forward.hpp#2613stephenberry wants to merge 1 commit into
stephenberry wants to merge 1 commit into
Conversation
…nto forward.hpp Extend glaze/forward.hpp with the remaining lightweight customization points flagged in review: - Forward declare glz::tuple_size / glz::tuple_element so user headers can register a tuple-like type without pulling in glaze/tuplet/tuple.hpp. The tuple_size_v / tuple_element_t helpers remain owned by tuple.hpp. - Forward declare glz::basic_raw_json (without its default argument, which stays owned by common.hpp) plus the raw_json / raw_json_view aliases, so glz::raw_json can be named (e.g. as a default template argument) without the full definition. - Move custom_impl() and the glz::custom customization point from core/wrappers.hpp to forward.hpp next to custom_t; both are trivial and depend only on custom_t. Adds <cstddef>, <string>, and <string_view> to forward.hpp's standard-library includes.
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.
Follow-up to the
glaze/forward.hppwork, addressing the additional types raised in review feedback on #2527.What
glz::tuple_size/glz::tuple_element— forward declare the primary templates (left incomplete) so user headers can register a tuple-like type via specialization without pulling inglaze/tuplet/tuple.hpp. The concretetuple_size_v/tuple_element_thelpers and thestd::specializations remain owned bytuple.hpp.glz::raw_json— forward declarebasic_raw_jsonplus theraw_json/raw_json_viewaliases, supporting use as a default template argument in a generic lambda, e.g.:std::string), leavingglaze/core/common.hppas the sole owner of the default and full definition.glz::custom—custom_impl()and thecustomcustomization point move fromglaze/core/wrappers.hppintoforward.hpp, next tocustom_t(which already lived there). Both are trivial and depend only oncustom_t.glz::error_code— intentionally left out; it doesn't appear to be used without its definition.forward.hppnow also includes<cstddef>,<string>, and<string_view>alongside<cstdint>.Verification
forward.hppstandalone compiles and exposes the new names (raw_json as a default template arg, a usertuple_size/tuple_elementspecialization,glz::custom).forward.hpp+ fullglaze.hppcompiles in both include orders with no redefinition or default-argument clashes.