Skip to content

Commit 86fb84d

Browse files
committed
Prevent static local in constructor to compile with C++17 too
1 parent 61b2464 commit 86fb84d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/beman/cstring_view/cstring_view.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class basic_cstring_view {
110110

111111
// [cstring.view.cons], construction and assignment
112112
constexpr basic_cstring_view() noexcept : size_() {
113-
static const charT empty_string[1]{};
113+
// XXX static const charT empty_string[1]{};
114114
data_ = std::data(empty_string);
115115
}
116116
constexpr basic_cstring_view(const basic_cstring_view&) noexcept = default;
@@ -313,6 +313,8 @@ class basic_cstring_view {
313313
private:
314314
const_pointer data_; // exposition only
315315
size_type size_; // exposition only
316+
317+
static constexpr charT empty_string[1]{}; // NOLINT
316318
};
317319

318320
inline namespace literals {

0 commit comments

Comments
 (0)