From 108258e3998c577abddf19d3d72ae63c981b41b1 Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Fri, 12 Sep 2025 16:07:13 -0600 Subject: [PATCH] :sparkles: Expose types in `type_pair` Problem: - Iterating a `type_map` is fine using `template_for_each` but it's difficult to extract the first and second (or key and value) types. Solution: - Add `first_type` and `second_type` to `type_pair`. - Add `key_type` and `value_type` to `type_pair`. --- include/stdx/utility.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/stdx/utility.hpp b/include/stdx/utility.hpp index 11c22b9..e406a6b 100644 --- a/include/stdx/utility.hpp +++ b/include/stdx/utility.hpp @@ -31,7 +31,12 @@ template struct value_t { }; } // namespace detail -template struct type_pair {}; +template struct type_pair { + using first_type = K; + using second_type = V; + using key_type = K; + using value_type = V; +}; template using tt_pair = type_pair; template using vt_pair = tt_pair, V>; template using tv_pair = tt_pair>;