diff options
author | Marco Bubke <marco.bubke@qt.io> | 2023-05-15 14:04:34 +0200 |
---|---|---|
committer | Marco Bubke <marco.bubke@qt.io> | 2023-05-16 08:45:43 +0000 |
commit | 8b2d7977ca74c09e12d235d16a5c6473e60e9961 (patch) | |
tree | f1bfdb3dcc5ea5bbee07e6466645332005686b8d | |
parent | 4195b4e7e2b0da842f043233074c5a479450691d (diff) | |
download | qt-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>
-rw-r--r-- | src/libs/utils/expected.h | 15 |
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. |