diff options
author | Marco Bubke <marco.bubke@qt.io> | 2020-05-22 19:05:45 +0200 |
---|---|---|
committer | Marco Bubke <marco.bubke@qt.io> | 2020-05-27 13:09:03 +0000 |
commit | 0b3d03121fbdf3ac913ee32e5a41c626488c95b0 (patch) | |
tree | e5af60f0e3307c22afdbdfbb571485b3dba1277e /src/libs/utils/smallstringfwd.h | |
parent | 64cbffe959c2dd10730818577a61d7fabeb734ea (diff) |
Utils: Modernize SmallString
Use more C++ api and constexpr. With C++ 17 we can use even more.
Change-Id: I33934cd7e087c311bf98501442df848bdb108279
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/libs/utils/smallstringfwd.h')
-rw-r--r-- | src/libs/utils/smallstringfwd.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/libs/utils/smallstringfwd.h b/src/libs/utils/smallstringfwd.h index 05a8a9efb4..0740cdf462 100644 --- a/src/libs/utils/smallstringfwd.h +++ b/src/libs/utils/smallstringfwd.h @@ -25,6 +25,18 @@ #pragma once +#if __cplusplus >= 201703L +#define constexpr17 constexpr +#else +#define constexpr17 inline +#endif + +#if __cplusplus >= 202002L +#define constexpr20 constexpr +#else +#define constexpr20 inline +#endif + using uint = unsigned int; namespace Utils { @@ -35,9 +47,4 @@ class BasicSmallString; using SmallString = BasicSmallString<31>; using PathString = BasicSmallString<190>; -inline -int compare(SmallStringView first, SmallStringView second) noexcept; -inline -int reverseCompare(SmallStringView first, SmallStringView second) noexcept; - } // namespace Utils |