rx/refl: reduce memory usage

This commit is contained in:
DH 2025-10-16 11:42:35 +03:00
parent ef5da501f7
commit fd28e613aa

View file

@ -130,7 +130,7 @@ template <auto &&V> constexpr auto getNameOf() {
"V = ";
#endif
constexpr auto name = detail::unwrapName(prefix, RX_PRETTY_FUNCTION, true);
static constexpr auto result = rx::StaticString<name.size() + 1>{name};
static constexpr auto result = rx::StaticString<name.size()>{name};
return std::string_view{result};
}
@ -147,7 +147,7 @@ constexpr auto getNameOf() {
#endif
constexpr auto name = detail::unwrapName(prefix, RX_PRETTY_FUNCTION, true);
static constexpr auto result = rx::StaticString<name.size() + 1>{name};
static constexpr auto result = rx::StaticString<name.size()>{name};
return std::string_view{result};
}
@ -159,7 +159,7 @@ template <typename T> constexpr auto getNameOf() {
"T = ";
#endif
constexpr auto name = detail::unwrapName(prefix, RX_PRETTY_FUNCTION, false);
static constexpr auto result = rx::StaticString<name.size() + 1>{name};
static constexpr auto result = rx::StaticString<name.size()>{name};
return std::string_view{result};
}