Repository navigation
Conversation
elbeno
requested review from
SANTOSHKUMARLAXMINARAYANRAI,
lukevalenty,
mjcaisse-intel and
siauthun
October 9, 2026 15:14
elbeno
force-pushed
the
type-map-indexing
branch
2 times, most recently
from
October 9, 2026 21:14
5083ff8 to
a494d8b
Compare
Problem: - Having to type out `stdx::type_lookup_t<M, K>` (or any of its variations for type-value combinations) is cumbersome, especially if you have a nested map type. Solution: - Provide `operator[]` for looking up types and `operator()` for looking up values. (Providing both in one operator would be much more complex, if at all possible/nice.) Note: - In the case where an incomplete type is the key or value in a `type_map`, the argument/return types can be `type_identity<T>`. - Because `operator()` takes a (non-constexpr) argument, conventional use is to pass this as an `integral_constant` or `cts_t`: something that exposes a `constexpr static` `value`.
elbeno
force-pushed
the
type-map-indexing
branch
from
October 9, 2026 21:15
a494d8b to
2e12ef1
Compare
This branch has not been deployed
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.
Problem:
stdx::type_lookup_t<M, K>(or any of its variations for type-value combinations) is cumbersome, especially if you have a nested map type.Solution:
operator[]for looking up types andoperator()for looking up values. (Providing both in one operator would be much more complex, if at all possible/nice.)Note:
type_map, the argument/return types can betype_identity<T>.operator()takes a (non-constexpr) argument, conventional use is to pass this as anintegral_constantorcts_t: something that exposes aconstexpr staticvalue.