Skip to content

Move the mpl facilities into functional/mpl/ and split off the convenience layer - #1602

Open
trueqbit wants to merge 8 commits into
devfrom
refactor/mpl-folder
Open

trueqbit wants to merge 8 commits into
devfrom
refactor/mpl-folder

Conversation

@trueqbit

@trueqbit trueqbit commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #1596.

functional/mpl.h sat beside the functional/mpl/ folder, which held only conditional.h, and mixed two layers: the mpl base in sqlite_orm::internal::mpl and the convenience quoted metafunctions in sqlite_orm::internal.

  • functional/mpl.h moves to functional/mpl/quoted_metafunctions.h (pure move, its own commit).
  • The convenience quoted metafunctions (check_if*, finds_if_has*, finds_satisfied_by, counts_if_has) move to functional/mpl/convenience.h, into the inline namespace internal::mpl::convenience. internal nominates it with a using-directive, so their unqualified uses inside internal are unchanged.
  • Headers using only the mpl base include mpl/quoted_metafunctions.h, the others mpl/convenience.h; table_definitions.h and serializing_util.h now include it instead of relying on transitive inclusion. Likewise, node_tuple.h and storage.h now include mpl/conditional.h for mpl::conditional_t.
  • The aliases of functional/tuple_helper/tuple_traits.h (tuple_has*, find_tuple_*, count_tuple) invoke the convenience quoted metafunctions directly on any type list, so they move into mpl/convenience.h as well; tuple_traits.h is gone.
  • mpl::transforms<Q> and mpl::transforms_fn<Fn> join finds/counts/contains in the mpl base; transforms_fn invokes Fn directly instead of through the SFINAE-friendly quote_fn, so errors in Fn (e.g. an unsupported column expression) surface unaltered. transform_tuple_t becomes their convenience invocation transform_tuple, without _t like count_tuple; the ad-hoc tuple_transformer struct is gone.
  • same_or_void (formerly tuple_helper/same_or_void.h) is a trait over a parameter pack, unrelated to tuples, and moves into functional/type_traits.h. tuple_helper/ now holds only operations on std::tuple.
  • is_quoted_metafuntion is corrected to is_quoted_metafun**c**tion, and the doc comments of counts and contains describe what they return.

All of it is internal; consumers observe no change.

🤖 Generated with Claude Code

The mpl facilities now live entirely in the functional/mpl/ folder, next to
mpl/conditional.h, instead of in a header beside the folder.

Co-Authored-By: Claude Opus 5
…ience.h

The `check_if*`, `finds_if_has*`, `finds_satisfied_by` and `counts_if_has`
compositions move out of mpl/quoted_metafunctions.h into the inline namespace
`internal::mpl::convenience`, which `internal` nominates with a
using-directive, so their unqualified uses inside `internal` stay unchanged.

Headers using only the mpl base include mpl/quoted_metafunctions.h, the others
mpl/convenience.h; table_definitions.h and serializing_util.h now include it
instead of relying on transitive inclusion.

Co-Authored-By: Claude Opus 5
node_tuple.h and storage.h relied on transitive inclusion.

Co-Authored-By: Claude Opus 5
Base automatically changed from refactor/functional-config-split to dev October 24, 2026 10:42
`tuple_has*`, `find_tuple_*` and `count_tuple` invoke the convenience quoted
metafunctions directly on any type list, so they move from
functional/tuple_helper/tuple_traits.h into functional/mpl/convenience.h,
inside the inline namespace `mpl::convenience`.

Co-Authored-By: Claude Opus 5
It is a type trait over a parameter pack, unrelated to tuples, so it joins
the generic internal type traits next to `common_type_of`.

Co-Authored-By: Claude Opus 5
`mpl::transforms<Q>` and `mpl::transforms_fn<Fn>` join `finds`, `counts` and
`contains` in the mpl base; `transforms_fn` invokes `Fn` directly rather than
through the SFINAE-friendly `quote_fn`, so that errors in `Fn` surface
unaltered. `transform_tuple_t` moves into the convenience layer as its
invocation, and the ad-hoc `tuple_transformer` struct is gone;
functional/tuple_helper/tuple_transformer.h keeps the value-level
recombination and construction from tuples.

Co-Authored-By: Claude Opus 5
mpl computations are read through `mpl::invoke_t`, and the convenience
invocations (`count_tuple`, `find_tuple_type`, ...) carry no `_t` suffix.

Co-Authored-By: Claude Opus 5

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant