Utils: Remove Utils::optional

Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.

Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Eike Ziller
2022-08-26 10:30:00 +02:00
parent 34a9491a08
commit 04e50438eb
247 changed files with 1053 additions and 3751 deletions

View File

@@ -3346,7 +3346,7 @@ void InsertDefsFromDecls::match(const CppQuickFixInterface &interface, QuickFixO
namespace {
Utils::optional<FullySpecifiedType> getFirstTemplateParameter(const Name *name)
std::optional<FullySpecifiedType> getFirstTemplateParameter(const Name *name)
{
if (const QualifiedNameId *qualifiedName = name->asQualifiedNameId())
return getFirstTemplateParameter(qualifiedName->name());
@@ -3358,7 +3358,7 @@ Utils::optional<FullySpecifiedType> getFirstTemplateParameter(const Name *name)
return {};
}
Utils::optional<FullySpecifiedType> getFirstTemplateParameter(Type *type)
std::optional<FullySpecifiedType> getFirstTemplateParameter(Type *type)
{
if (NamedType *namedType = type->asNamedType())
return getFirstTemplateParameter(namedType->name());
@@ -3366,7 +3366,7 @@ Utils::optional<FullySpecifiedType> getFirstTemplateParameter(Type *type)
return {};
}
Utils::optional<FullySpecifiedType> getFirstTemplateParameter(FullySpecifiedType type)
std::optional<FullySpecifiedType> getFirstTemplateParameter(FullySpecifiedType type)
{
return getFirstTemplateParameter(type.type());
}
@@ -3870,7 +3870,7 @@ void GetterSetterRefactoringHelper::performGeneration(ExistingGetterSetterData d
getSetTemplate.replacePlaceholders(data.memberVariableName, parameterName);
using Pattern = CppQuickFixSettings::GetterSetterTemplate;
Utils::optional<FullySpecifiedType> returnTypeTemplateParameter;
std::optional<FullySpecifiedType> returnTypeTemplateParameter;
if (getSetTemplate.returnTypeTemplate.has_value()) {
QString returnTypeTemplate = getSetTemplate.returnTypeTemplate.value();
if (returnTypeTemplate.contains(Pattern::TEMPLATE_PARAMETER_PATTERN)) {