summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2023-05-15 14:04:34 +0200
committerMarco Bubke <marco.bubke@qt.io>2023-05-16 08:45:43 +0000
commit8b2d7977ca74c09e12d235d16a5c6473e60e9961 (patch)
treef1bfdb3dcc5ea5bbee07e6466645332005686b8d /src
parent4195b4e7e2b0da842f043233074c5a479450691d (diff)
downloadqt-creator-8b2d7977ca74c09e12d235d16a5c6473e60e9961.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>
Diffstat (limited to 'src')
-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.