refactor: text_tools made consteval and [[nodiscard]]

This commit is contained in:
Mateusz Pusz
2022-10-21 23:10:56 +02:00
parent b734880903
commit 4b83b3a2ee

View File

@@ -57,7 +57,7 @@ inline constexpr basic_symbol_text superscript_minus("\u207b", "-");
inline constexpr basic_symbol_text superscript_prefix("", "^");
template<std::intmax_t Value>
constexpr auto superscript_helper()
[[nodiscard]] consteval auto superscript_helper()
{
if constexpr (Value < 0)
return superscript_minus + superscript_helper<-Value>();
@@ -68,13 +68,13 @@ constexpr auto superscript_helper()
}
template<std::intmax_t Value>
constexpr auto superscript()
[[nodiscard]] consteval auto superscript()
{
return superscript_prefix + superscript_helper<Value>();
}
template<std::intmax_t Value>
constexpr auto regular()
[[nodiscard]] consteval auto regular()
{
if constexpr (Value < 0)
return basic_fixed_string("-") + superscript_helper<-Value>();