std::experi...w::operator=(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– NAME πŸ’–

Okay so bestie, this page is std::experi...w::operator=(3) from the C++ Standard Libary manual (that spelling is literally in the header, I’m not doing that πŸ’€).

The NAME block is giving double trouble:

std::experimental::basic_string_view::operator= - std::experimental::basic_string_view::operator=

Yes, it says it twice. Iconic. Periodt. πŸ’…


✨ Synopsis ✨

basic_string_view& operator=( const basic_string_view&     (library
fundamentals TS)
          view ) noexcept = default;

Replaces the view with that of view. That’s the whole vibe. πŸ¦‹


🌸 Parameters 🌸

  • view β€” view to copy πŸ’–

πŸŽ€ Return value πŸŽ€

*this β€” that’s what comes back, no cap. 🫢


⭐ Complexity ⭐

Constant. Lowkey perfect. ✨


🧚 Example 🧚

// Run this code

#include <iostream>
#include <experimental/string_view>
int main()
{
    std::experimental::string_view v = "Hello, world";
    v = v.substr(7);
    std::cout << v << '\n';
}

Output:

world

Ate. πŸ’…


πŸ”₯ See also πŸ”₯

  • constructor β€” constructs a basic_string_view (public member function)

🌈 Category: 🌈

  • Noindexed pages

Made with πŸ’– from the http://cppreference.com source, version/date 2024.06.10, and the footer title std::experi...w::operator=(3). Bye bestie, go assign some views responsibly πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from