diff --git a/include/stdx/ct_string.hpp b/include/stdx/ct_string.hpp index 1b72874..d316549 100644 --- a/include/stdx/ct_string.hpp +++ b/include/stdx/ct_string.hpp @@ -99,6 +99,9 @@ template typename T> }(std::make_index_sequence{}); } +template typename T> +using ct_string_to_type_t = decltype(ct_string_to_type()); + template [[nodiscard]] consteval auto split() { constexpr auto it = [] { for (auto i = S.value.cbegin(); i != S.value.cend(); ++i) { diff --git a/test/ct_string.cpp b/test/ct_string.cpp index f7f44c5..19389f1 100644 --- a/test/ct_string.cpp +++ b/test/ct_string.cpp @@ -59,6 +59,12 @@ TEST_CASE("to type", "[ct_string]") { string_constant const>); } +TEST_CASE("to type_t", "[ct_string]") { + constexpr auto s = stdx::ct_string{"ABC"}; + using sc = stdx::ct_string_to_type_t; + static_assert(std::is_same_v>); +} + TEST_CASE("to string_view", "[ct_string]") { constexpr auto s = stdx::ct_string{"ABC"}; auto const sv = static_cast(s);