@@ -62,9 +62,9 @@ class BasicFormatString
62
62
* string. If valid, the format parsing context will be advanced to the character after the
63
63
* closing brace.
64
64
*
65
- * @return If successful, the parsed replacement field. Otherwise, an uninitialized value .
65
+ * @return The parsed replacement field.
66
66
*/
67
- constexpr std::optional< FormatSpecifier> parse_specifier ();
67
+ constexpr FormatSpecifier parse_specifier ();
68
68
69
69
/* *
70
70
* Parse a replacement field for a user-defined type.
@@ -118,9 +118,9 @@ FLY_CONSTEVAL BasicFormatString<CharType, ParameterTypes...>::BasicFormatString(
118
118
{
119
119
m_context.on_error (" Exceeded maximum allowed number of specifiers" );
120
120
}
121
- else if ( auto specifier = parse_specifier (); specifier)
121
+ else
122
122
{
123
- m_specifiers[m_specifier_count++] = * std::move (specifier );
123
+ m_specifiers[m_specifier_count++] = parse_specifier ( );
124
124
}
125
125
}
126
126
else if (ch == s_right_brace)
@@ -158,8 +158,7 @@ auto BasicFormatString<CharType, ParameterTypes...>::next_specifier()
158
158
159
159
// ==================================================================================================
160
160
template <typename CharType, typename ... ParameterTypes>
161
- constexpr auto BasicFormatString<CharType, ParameterTypes...>::parse_specifier()
162
- -> std::optional<FormatSpecifier>
161
+ constexpr auto BasicFormatString<CharType, ParameterTypes...>::parse_specifier() -> FormatSpecifier
163
162
{
164
163
// The opening { will have already been consumed, so the starting position is one less.
165
164
const auto starting_position = m_context.lexer ().position () - 1 ;
0 commit comments