| Index: compiled/String.h |
| diff --git a/compiled/String.h b/compiled/String.h |
| index 901602d882889a52491ba0f4cd1e66cbaf48b180..4de08d1c0a3e7927a53bae5447b760a2f5277c1f 100644 |
| --- a/compiled/String.h |
| +++ b/compiled/String.h |
| @@ -61,14 +61,12 @@ protected: |
| value_type* mBuf; |
| size_type mLen; |
| - explicit String(value_type* buf, size_type len, size_type flags) |
| + constexpr explicit String(value_type* buf, size_type len, size_type flags) |
| : mBuf(buf), mLen((len & LENGTH_MASK) | flags) |
| { |
| } |
| - ~String() |
| - { |
| - } |
| + ~String() = default; |
| void reset(value_type* buf, size_type len, size_type flags) |
| { |
| @@ -77,12 +75,12 @@ protected: |
| } |
| public: |
| - size_type length() const |
| + constexpr size_type length() const |
| { |
| return mLen & LENGTH_MASK; |
| } |
| - bool empty() const |
| + constexpr bool empty() const |
| { |
| return !(mLen & LENGTH_MASK); |
| } |
| @@ -109,7 +107,7 @@ public: |
| return mBuf[pos]; |
| } |
| - bool is_writable() const |
| + constexpr bool is_writable() const |
| { |
| return (mLen & FLAGS_MASK) == READ_WRITE; |
| } |
| @@ -179,12 +177,12 @@ public: |
| return npos; |
| } |
| - bool is_invalid() const |
| + constexpr bool is_invalid() const |
| { |
| return (mLen & FLAGS_MASK) == INVALID; |
| } |
| - bool is_deleted() const |
| + constexpr bool is_deleted() const |
| { |
| return (mLen & FLAGS_MASK) == DELETED; |
| } |
| @@ -231,6 +229,12 @@ public: |
| { |
| } |
| + template <int N1> |
| + constexpr explicit DependentString(const value_type (&buf)[N1]) |
| + : String(const_cast<value_type*>(buf), N1 - 1, READ_ONLY) |
| + { |
| + } |
| + |
| explicit DependentString(value_type* buf, size_type len) |
| : String(buf, len, READ_WRITE) |
| { |