Skip to content

Regroup functional/type_traits.h and split off the reference_wrapper unwrapping - #1604

Open
trueqbit wants to merge 11 commits into
refactor/mpl-conditional-sweepfrom
refactor/functional-type-traits
Open

trueqbit wants to merge 11 commits into
refactor/mpl-conditional-sweepfrom
refactor/functional-type-traits

Conversation

@trueqbit

@trueqbit trueqbit commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #1603.

functional/type_traits.h filed a std::reference_wrapper unwrapping facility, including functions, under "C++ generic traits", and its other groups only partly matched their headings.

  • value_unref_type, forward_ref, forward_lvalue_ref and unwrap_ref_or_forward move to functional/ref_unwrapping.h (pure move, its own commit); their users include it. Their comments are condensed to what each entity is, and the one of value_unref_type no longer claims a remove_cvref the trait does not apply.
  • What stays in type_traits.h is grouped as generic type traits (is_eval_order_guaranteed, stateless), type algorithms over packs (is_any_of, common_type_of, same_or_void), SFINAE helpers and type name projectors.
  • satisfies_is_specialization_of is renamed to satisfies_specialization_of, so that each SFINAE helper for functions mirrors its counterpart for types (match_if/satisfies, match_if_not/satisfies_not, match_specialization_of/satisfies_specialization_of).
  • argument_placeholders.h uses std::common_type directly instead of wrapping the resolved types into a std::tuple for common_type_of to unpack.
  • is_eval_order_garanteed is renamed to is_eval_order_guaranteed, and "garanteed" is corrected in two comments of sqlite3_xdestroy.h.

All of it is internal; consumers observe no change.

🤖 Generated with Claude Code

`value_unref_type`, `forward_ref`, `forward_lvalue_ref` and
`unwrap_ref_or_forward` move into functional/ref_unwrapping.h, together with
the `<utility>`/`<functional>` include they need; their users include it.

Co-Authored-By: Claude Opus 5
…mments

- Groups under accurate headings: generic type traits (`is_any_of`,
  `is_eval_order_guaranteed`, `stateless`), type computations over packs
  (`common_type_of`, `same_or_void`), SFINAE helpers and type name projectors.
- Removes `match_specialization_of` and `satisfies_is_specialization_of`; the
  one use of the former in column_result_proxy.h tests
  `polyfill::is_specialization_of_v` directly.
- Fixes the spelling of `is_eval_order_guaranteed`, and "guaranteed" in
  sqlite3_xdestroy.h.
- The ref_unwrapping.h comments state what each entity is; the one of
  `value_unref_type` no longer claims a `remove_cvref` it does not apply.

Co-Authored-By: Claude Opus 5
Like `common_type_of` and `same_or_void`, `is_any_of` computes over a pack of
types rather than classifying a single type.

Co-Authored-By: Claude Opus 5
The common argument type was computed by wrapping the resolved types into a
`std::tuple` only for `common_type_of` to unpack them again.

Co-Authored-By: Claude Opus 5
…l-type-traits

# Conflicts:
#	dev/marshaling/column_result_proxy.h
#	include/sqlite_orm/sqlite_orm.h
`polyfill::is_specialization_of` takes a template template parameter, so it
cannot be passed to `match_if`/`satisfies`; the two helpers complete the
SFINAE helpers for it. column_result_proxy.h uses `match_specialization_of`
again.

Co-Authored-By: Claude Opus 5
Each SFINAE helper for functions mirrors the name of its counterpart for
types: `match_if`/`satisfies`, `match_if_not`/`satisfies_not`,
`match_specialization_of`/`satisfies_specialization_of`.

Co-Authored-By: Claude Opus 5
ref_unwrapping.h includes `<utility>` for `std::forward` and `std::declval`
unconditionally rather than only in the C++20 branch for
`std::reference_wrapper`. The include comments of type_traits.h and
accessors.h name what is used.

Co-Authored-By: Claude Opus 5
…erence

`<utility>` is included unconditionally now, so the C++20 branch of the
conditional was redundant.

Co-Authored-By: Claude Opus 5
@trueqbit
trueqbit marked this pull request as ready for review October 24, 2026 20:28
…plate

`Template` names any class template, as in `check_if_is_template` and
`find_tuple_template`.

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