summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2023-05-15 14:04:34 +0200
committerTim Jenssen <tim.jenssen@qt.io>2023-05-16 14:38:12 +0000
commit77b2c82f05955420fd600b68d392bc68156c8982 (patch)
treeb30fd91b0ae90d8030053a885b6286c62200a215
parent9dbb312d775e6b6339206c1ad5d552d031c09835 (diff)
downloadqt-creator-77b2c82f05955420fd600b68d392bc68156c8982.tar.gz
Utils: Make CTAD work with std::unexpected
Aliases are not working with CTAD before C++ 20. Instead of aliasing some types we simply importing the namespace tl into the namespace Utils. This enables some not aliased things too. Change-Id: Ic61a50bedbbf7253ecb5bb1f6dc0624dcc704aa0 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 8b2d7977ca74c09e12d235d16a5c6473e60e9961) Reviewed-by: Marco Bubke <marco.bubke@qt.io>
-rw-r--r--src/libs/utils/expected.h15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/libs/utils/expected.h b/src/libs/utils/expected.h
index 943cfe5591..33231c1246 100644
--- a/src/libs/utils/expected.h
+++ b/src/libs/utils/expected.h
@@ -9,24 +9,11 @@
namespace Utils {
-template<class T, class E>
-using expected = tl::expected<T, E>;
+using namespace tl;
template<class T>
using expected_str = tl::expected<T, QString>;
-template<class E>
-using unexpected = tl::unexpected<E>;
-using unexpect_t = tl::unexpect_t;
-
-static constexpr unexpect_t unexpect{};
-
-template<class E>
-constexpr unexpected<std::decay_t<E>> make_unexpected(E &&e)
-{
- return tl::make_unexpected(e);
-}
-
} // namespace Utils
//! If 'expected' has an error the error will be printed and the 'action' will be executed.