約47,900件1ページ目

日本語のみで絞り込む

Copies the substring [ pos , pos + rcount ) to the character array pointed to by dest , where rcount is the smaller of count and size() - pos .

2025/3/14 -I am trying to copy a series of std::string_view s into a std::vector<char> container, without causing additional memory allocation.

2026/3/24 -std::string_view is a non-owning, read-only window into a string. It doesn't allocate memory, it doesn't copy data, and it makes your string- ...

2017/4/16 -The purpose of std::string_view is to avoid copying data already owned by someone else and of which only a non-mutating view is required.

Copies the substring [ pos, pos + rcount ) to the character array pointed to by dest , where rcount is std::min(count, size() - pos) .

2017/6/20 -So your only option is to copy the contents to a new object, i.e. std::string . Therefore c_str cannot work on string_view in many cases without ...

Consequently, making a copy of a string_view is a shallow operation: no string data is copied. string_view has implicit conversion constructors from both const ...

2023/6/7 -Lightweight, low overhead: Creating, copying, and passing around a string_view does not copy the underlying string data. In contrast, copying a ...

Every time you pass a std::string by value, you copy the whole buffer. Often a function only wants to read the characters. std::string_view is a tiny object — ...

2025/7/15 -Unlike std::string, which keeps its own copy of the string, It also provides a view of a string that is defined elsewhere in the source code. it ...