std::match_...atch_results(3)

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

πŸ’– std::match_results::match_results πŸ’–

okay so bestie, this is the std::match_results::match_results page from the C++ Standard Libary manual (spelling exactly as the header gives it πŸ‘€), and the page tag in the header is std::match_...atch_results(3) β€” yes, it's literally abbreviated like that πŸ’…. We're talking constructors today, and it's giving very self-titled icon behavior πŸ‘‘.


🌸 NAME 🌸

std::match_results::match_results β€” the constructor for std::match_results, literally right there in the name. no cap.

✨ Synopsis ✨

match_results() : match_results(Allocator()) {}                (1)
(since C++11)
explicit match_results( const Allocator& a );                  (2)
(since C++11)
match_results( const match_results& rhs );                     (3)
(since C++11)
match_results( const match_results& rhs, const Allocator& a ); (4)
(since C++11)
match_results( match_results&& rhs ) noexcept;                 (5)
(since C++11)
match_results( match_results&& rhs, const Allocator& a );      (6)
(since C++11)

Here's the group chat recap of each one, bestie:

  • 1) Default constructor. Constructs a match result with no established result state (ready() != true). (since C++11)
  • 2) Constructs a match result with no established result state (ready() != true) using a copy of a as the allocator. (since C++11) Also, this one is explicit, so don't get cute with implicit conversions.
  • 3) Copy constructor. Constructs a match result with a copy of rhs. (since C++11)
  • 4) Constructs a match result with a copy of rhs, and uses a copy of a as the allocator. (since C++11)
  • 5) Move constructor. Constructs a match result with the contents of rhs using move semantics. rhs is in valid, but unspecified state after the call. (since C++11) This one is noexcept, slay.
  • 6) Constructs a match result with the contents of rhs using move semantics, and uses a copy of a as the allocator. rhs is in valid, but unspecified state after the call. (since C++11)

πŸ’– Parameters πŸ’–

  • a β€” allocator to use for all memory allocations of this container.
  • rhs β€” another match_results to use as source to initialize the match_results with.

πŸ”₯ Exceptions πŸ”₯

  • 1–4) May throw implementation-defined exceptions.
  • 6) Throws nothing if a == rhs.get_allocator() is true.
bestie, notice that only 1–4 and 6 get exception notes here. don't invent extra lore for the others πŸ‘€

😭 Example 😭

This section is incomplete.

Reason: no example.

πŸ’€ Defect reports πŸ’€

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

  • LWG 2195 β€” applied to C++11. Behavior as published: the constructors required by AllocatorAwareContainer were missing. Correct behavior: added.
  • P0935R0 β€” applied to C++11. Behavior as published: default constructor was explicit. Correct behavior: made implicit.

πŸŽ€ Category πŸŽ€

  • Todo no example

xoxo, bestie 🫢 this page is from http://cppreference.com, dated 2024.06.10, and the footer tag reads std::match_...atch_results(3) β€” periodt. πŸ’–

πŸ“¦ where this page comes from