@@ -22,7 +22,7 @@ namespace detail {
22
22
template <typename T>
23
23
concept format_convertible = requires (T t) {
24
24
{ T::ct_string_convertible () } -> std::same_as<std::true_type>;
25
- { ct_string{t. str . value } };
25
+ { ct_string{+t } };
26
26
};
27
27
} // namespace detail
28
28
@@ -39,7 +39,7 @@ template <std::size_t N> struct ct_string {
39
39
40
40
template <detail::format_convertible T>
41
41
// NOLINTNEXTLINE(google-explicit-constructor)
42
- CONSTEVAL explicit (false ) ct_string(T t) : ct_string(t.str.value ) {}
42
+ CONSTEVAL explicit (false ) ct_string(T t) : ct_string(+t ) {}
43
43
44
44
CONSTEVAL explicit (true ) ct_string(char const *str, std::size_t sz) {
45
45
for (auto i = std::size_t {}; i < sz; ++i) {
@@ -78,7 +78,7 @@ template <std::size_t N> struct ct_string {
78
78
};
79
79
80
80
template <detail::format_convertible T>
81
- ct_string (T) -> ct_string<decltype(std::declval<T>().str.value )::capacity()>;
81
+ ct_string (T) -> ct_string<decltype(+ std::declval<T>())::capacity()>;
82
82
83
83
template <std::size_t N, std::size_t M>
84
84
[[nodiscard]] constexpr auto operator ==(ct_string<N> const &lhs,
@@ -142,6 +142,9 @@ template <std::size_t N, std::size_t M>
142
142
template <ct_string S> struct cts_t {
143
143
using value_type = decltype (S);
144
144
constexpr static auto value = S;
145
+
146
+ CONSTEVAL static auto ct_string_convertible () -> std::true_type;
147
+ friend constexpr auto operator +(cts_t const &) { return value; }
145
148
};
146
149
147
150
template <ct_string X, ct_string Y>
0 commit comments