Replace stray uses of std::make_optional
C++17 CTAD makes it unnecessary.
This commit is contained in:
parent
291be986f6
commit
b505f8f744
3 changed files with 3 additions and 3 deletions
|
@ -100,7 +100,7 @@ std::optional<credits_data::const_iterator> get_campaign_credits(const std::stri
|
|||
{
|
||||
const auto res = std::find_if(parsed_credits_data.begin(), parsed_credits_data.end(),
|
||||
[&campaign](const credits_group& group) { return group.id == campaign; });
|
||||
return res != parsed_credits_data.end() ? std::make_optional(res) : std::nullopt;
|
||||
return res != parsed_credits_data.end() ? std::optional{res} : std::nullopt;
|
||||
}
|
||||
|
||||
std::vector<std::string> get_background_images(const std::string& campaign)
|
||||
|
|
|
@ -134,7 +134,7 @@ template<typename T>
|
|||
std::optional<T> locator::copy_from_cache(cache_type<T>& cache) const
|
||||
{
|
||||
const auto& elem = cache.get_element(val_);
|
||||
return elem.loaded ? std::make_optional(elem.item) : std::nullopt;
|
||||
return elem.loaded ? std::optional{elem.item} : std::nullopt;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
|
|
@ -24,7 +24,7 @@ std::optional<T> from_chars(std::string_view str, int base = 10)
|
|||
static_assert(std::is_integral_v<T>, "Float support for charconv incomplete on current build requirements");
|
||||
T result {};
|
||||
const auto [_, ec] = std::from_chars(str.data(), str.data() + str.size(), result, base);
|
||||
return ec == std::errc{} ? std::make_optional(result) : std::nullopt;
|
||||
return ec == std::errc{} ? std::optional{result} : std::nullopt;
|
||||
}
|
||||
|
||||
} // namespace utils
|
||||
|
|
Loading…
Add table
Reference in a new issue