Util: Use C++20 designated initializer lists on structs
This commit is contained in:
@@ -46,7 +46,7 @@ void Formatter<const char*>::parse(Parser& parser)
|
||||
void Formatter<const char*>::format(Builder& builder, const char* value) const
|
||||
{
|
||||
if (specifier.type == PresentationType::Pointer) {
|
||||
Formatter<const void*> formatter { specifier };
|
||||
Formatter<const void*> formatter { .specifier = specifier };
|
||||
formatter.format(builder, static_cast<const void*>(value));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ struct Formatter<T> {
|
||||
if (specifier.type == PresentationType::Character) {
|
||||
assert(value >= 0 && value <= 127);
|
||||
|
||||
Formatter<std::string_view> formatter { specifier };
|
||||
Formatter<std::string_view> formatter { .specifier = specifier };
|
||||
formatter.specifier.type = PresentationType::String;
|
||||
return formatter.format(builder, { reinterpret_cast<const char*>(&value), 1 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user