Repository navigation
🎨 Allow ct_strings in type_map - #425
Merged
Merged
Conversation
Problem: - `type_map` does not easily allow pairs containing `ct_string`. This doesn't work: ```cpp using M = type_map<vt_pair<"A", X>, vt_pair<"B", Y>>; ``` - `type_map` returns `void` or `0` on a miss, either of which might be valid entries. Solution: - Allow `ct_string`s to be used as keys, values and defaults in `type_map`. - On a miss, return a `missing_t` type (or value of that type) by default. Note: - This is a minor breaking change: downstream functions that check for `void` on a map lookup miss need to update. e.g. https://github.com/intel/compile-time-init-build/blob/main/include/interrupt/manager.hpp#L68
elbeno
requested review from
SANTOSHKUMARLAXMINARAYANRAI,
lukevalenty,
mjcaisse-intel and
siauthun
October 7, 2026 21:43
SANTOSHKUMARLAXMINARAYANRAI
approved these changes
Oct 8, 2026
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:
type_mapdoes not easily allow pairs containingct_string. This doesn't work:type_mapreturnsvoidor0on a miss, either of which might be valid entries.Solution:
ct_strings to be used as keys, values and defaults intype_map.missing_ttype (or value of that type) by default.Note:
voidon a map lookup miss need to update. e.g. https://github.com/intel/compile-time-init-build/blob/main/include/interrupt/manager.hpp#L68