Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      operator==,!=(std::match_results)

      From cppreference.com
      <cpp‎ |regex‎ |match results
       
       
       
      Regular expressions library
      Classes
      (C++11)
      Algorithms
      Iterators
      Exceptions
      Traits
      Constants
      (C++11)
      Regex Grammar
       
       
      Defined in header<regex>
      template<class BidirIt,class Alloc>

      bool operator==( match_results<BidirIt,Alloc>& lhs,

                       match_results<BidirIt,Alloc>& rhs);
      (1)(since C++11)
      template<class BidirIt,class Alloc>

      bool operator!=( match_results<BidirIt,Alloc>& lhs,

                       match_results<BidirIt,Alloc>& rhs);
      (2)(since C++11)
      (until C++20)

      Compares twomatch_results objects.

      Twomatch_results are equal if the following conditions are met:

      • neither of the objects isready,or
      • both match results areready and the following conditions are met:
      • lhs.empty() andrhs.empty(),or
      • !lhs.empty() and!rhs.empty() and the following conditions are met:
      • lhs.prefix()== rhs.prefix()
      • lhs.size()== rhs.size()&&std::equal(lhs.begin(), lhs.end(), rhs.begin())
      • lhs.suffix()== rhs.suffix()
      1) Checks iflhs andrhs are equal.
      2) Checks iflhs andrhs are not equal.

      The!= operator issynthesized fromoperator==.

      (since C++20)

      Contents

      [edit]Parameters

      lhs, rhs - match results to compare
      Type requirements
      -
      BidirIt must meet the requirements ofLegacyBidirectionalIterator.
      -
      Alloc must meet the requirements ofAllocator.

      [edit]Return value

      1)true iflhs andrhs are equal,false otherwise.
      2)true iflhs andrhs are not equal,false otherwise.

      [edit]Exceptions

      May throw implementation-defined exceptions.

      [edit]Example

      This section is incomplete
      Reason: no example
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/regex/match_results/operator_cmp&oldid=156906"

      [8]ページ先頭

      ©2009-2025 Movatter.jp