std::experi..._view::copy(3)
π std::experi..._view::copy(3) π
okay so this page is from the C++ Standard Library manual, and it's literally all about std::experimental::basic_string_view::copy. yes bestie, that whole entire name, we're not shortening it, it's iconic and it's staying.
β¨ NAME β¨
std::experimental::basic_string_view::copy β like, that's the function, that's the whole name, no notes π«Ά
πΈ SYNOPSIS πΈ
size_type copy( CharT* dest,
size_type count, (library fundamentals TS)
size_type pos = 0) const;
so the vibe here is: it copies the substring [pos, pos + rcount) over to the character string that dest is pointing at, and rcount is the smaller of count and size() - pos. that's the whole bit. lowkey elegant ngl π
π¦ PARAMETERS π¦
destβ pointer to the destination character string, a.k.a. where the good stuff goes β¨posβ position of the first character, like where you're starting from in the story πcountβ requested substring length, i.e. how much you're asking for π«
β RETURN VALUE β
number of characters copied. that's it, that's the answer, no drama π
π₯ EXCEPTIONS π₯
it throws std::out_of_range if pos > size(). so like, if you're trying to start past the end of the string, it WILL call you out and you will be perceived π
π COMPLEXITY π
linear in rcount. so the more you copy, the longer it takes β math is mathing, no cap π
π SEE ALSO π
substrβ returns a substring (public member function) β the little sibling energy is real, go check it out bestie π
π§ CATEGORY π§
- Noindexed pages (she's mysterious, she's not indexed, we respect it π)
heads up bestie: this whole thing is the library fundamentals TS version, so keep that in mind before you go copying it into your main character production code π
sign-off time π«Ά this lil cutie lives over at http://cppreference.com, dated 2024.06.10, and that's the tea β periodt β¨ππ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms