Commit ce4b04f
committed
feat: add std::string_view constructor to hashed_string
Adds a convenience constructor that accepts std::string_view directly,
eliminating the need to manually pass .data() and .size().
This addresses the gap mentioned in PR #824 where implicit conversion
to std::string_view was noted as desirable but not included.
Changes:
- Added basic_hashed_string(std::basic_string_view<value_type>) ctor
- Added corresponding test case StringViewConstructor
Example usage:
std::string_view sv = "foobar";
auto hs = entt::hashed_string{sv}; // Cleaner!
Related: PR #8241 parent 1333fa5 commit ce4b04f
2 files changed
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
128 | 136 | | |
129 | 137 | | |
130 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
88 | 99 | | |
89 | 100 | | |
90 | 101 | | |
| |||
0 commit comments