std::basic_...x::operator=(3)

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

πŸ’– std::basic_...x::operator=(3) πŸ’–

okay so bestie, welcome to the C++ Standard Libary manual page for std::basic_regex::operator= πŸ’… yes, that's the manual name, spelled Libary right on the page, and we are keeping the icon exactly as found πŸŽ€


🌸 NAME 🌸

std::basic_regex::operator= - std::basic_regex::operator=

It's literally the assignment operator for std::basic_regex. slay.

✨ Synopsis ✨

Defined in header <regex>.

basic_regex& operator=( const basic_regex& other );
(1) (since C++11)
basic_regex& operator=( basic_regex&& other ) noexcept;
(2) (since C++11)
basic_regex& operator=( const CharT* ptr );
(3) (since C++11)
basic_regex& operator=( std::initializer_list<CharT> il );
(4) (since C++11)
template< class ST, class SA >
(5) (since C++11)
basic_regex& operator=( const std::basic_string<CharT,ST,SA>& p );

Assigns the contents. Here's the overload-by-overload tea πŸ«–βœ¨

  1. Copy assignment operator. Assigns the contents of other. Equivalent to assign(other);.
  2. Move assignment operator. Assigns the contents of other using move semantics. After the operation, other is in a valid, but unspecified state. Equivalent to assign(other);.
  3. Assigns a null-terminated character string pointed to by ptr. Equivalent to assign(ptr);.
  4. Assigns characters contained in initializer list il. Equivalent to assign(il);.
  5. Assigns the contents of the string p. Equivalent to assign(p);.

πŸŽ€ Parameters πŸŽ€

  • other β€” another regex object.
  • ptr β€” pointer to a null-terminated character string.
  • il β€” initializer list containing characters to assign.
  • p β€” string containing characters to assign.

🌈 Return value 🌈

*this β€” that's the whole return value, no cap πŸ’…

πŸ”₯ Exceptions πŸ”₯

  • 1) β€” may throw implementation-defined exceptions.
  • 3-5) β€” std::regex_error if the supplied regular expression is not valid. The object is not modified in that case.
bestie, if the regex is invalid you get std::regex_error, and the object stays unmodified β€” no sneaky half-assignment energy πŸ’€

πŸ¦‹ See also πŸ¦‹

  • assign β€” assigns the contents (public member function).

Catch you later, bestie! This page came from http://cppreference.com, dated 2024.06.10, and it's the std::basic_...x::operator=(3) manual page. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from