Use std::size instead of sizeof in string_view example

This commit is contained in:
Chijun Sima
2018-08-24 15:03:36 +08:00
parent d386a48f3b
commit 46c20a843c
2 changed files with 2 additions and 2 deletions

View File

@@ -346,7 +346,7 @@ std::string_view cppstr{ "foo" };
std::wstring_view wcstr_v{ L"baz" };
// Character arrays.
char array[3] = {'b', 'a', 'r'};
std::string_view array_v(array, sizeof array);
std::string_view array_v(array, std::size(array));
```
```c++
std::string str{ " trim me" };