Utils: Make default constructor of SmallString constexpr

Change-Id: Ibf381c9f18de878b1f67e28498cd28270e9220c7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-01-23 18:05:04 +01:00
parent 4f0c17bc5d
commit 2f8c075a01
2 changed files with 2 additions and 2 deletions

View File

@@ -69,7 +69,7 @@ public:
? sizeof(Internal::StringDataLayout<Size>) == Size + 1 ? sizeof(Internal::StringDataLayout<Size>) == Size + 1
: sizeof(Internal::StringDataLayout<Size>) == Size + 2, : sizeof(Internal::StringDataLayout<Size>) == Size + 2,
"Size is wrong"); "Size is wrong");
constexpr
BasicSmallString() noexcept BasicSmallString() noexcept
: m_data(Internal::StringDataLayout<Size>()) : m_data(Internal::StringDataLayout<Size>())
{ {

View File

@@ -98,7 +98,7 @@ struct ALIGNAS_16 StringDataLayout {
: ((MaximumShortStringDataAreaSize + 2) % 16) == 0, : ((MaximumShortStringDataAreaSize + 2) % 16) == 0,
"Size + 1 must be dividable by 16 if under 64 and Size + 2 must be dividable by 16 if over 64!"); "Size + 1 must be dividable by 16 if under 64 and Size + 2 must be dividable by 16 if over 64!");
StringDataLayout() noexcept = default; constexpr StringDataLayout() noexcept = default;
constexpr StringDataLayout(const char *string, constexpr StringDataLayout(const char *string,
size_type size) noexcept size_type size) noexcept