Skip to content

Commit 2670a82

Browse files
committed
prefer enum to constexpr auto - it's shorter and simpler to read
1 parent 160fb8c commit 2670a82

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/string19.lib/string19/StringStore.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ template<size_t N> using CharArray = char[N];
1111
/// note: the stored array is always 0 terminated.
1212
/// also note: N is the number of actual characters (not including the trailing \0)
1313
template<size_t N> struct StringStore {
14+
enum { count = N };
1415
CharArray<N + 1> data{};
15-
static constexpr auto count = N;
1616

1717
constexpr char operator[](size_t i) const noexcept { return data[i]; }
1818
};
1919

2020
/// note: always use storeLiteral("Hello") - or you get a 2nd \0 into your string!
21-
template<size_t N> StringStore(const char (&)[N]) -> StringStore<N>;
21+
template<size_t N> StringStore(const char (&)[N])->StringStore<N>;
2222

2323
} // namespace string19

0 commit comments

Comments
 (0)