所有权指针明确
This commit is contained in:
@@ -36,12 +36,12 @@ std::span<const Plot_Definition> gallery_plot_definitions() noexcept {
|
||||
return definitions;
|
||||
}
|
||||
|
||||
std::optional<not_null<const Plot_Definition*>>
|
||||
const Plot_Definition*
|
||||
find_gallery_plot_definition(std::string_view id) noexcept {
|
||||
const auto found = std::ranges::find(definitions, id,
|
||||
&Plot_Definition::id);
|
||||
if (found == definitions.end()) return std::nullopt;
|
||||
return not_null{&*found};
|
||||
if (found == definitions.end()) return nullptr;
|
||||
return &*found;
|
||||
}
|
||||
|
||||
std::string_view plot_dimension_name(Plot_Dimension dimension) noexcept {
|
||||
|
||||
Reference in New Issue
Block a user