forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user