Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::sub_match<BidirIt>::compare

      From cppreference.com
      <cpp‎ |regex‎ |sub match
       
       
       
      Regular expressions library
      Classes
      (C++11)
      Algorithms
      Iterators
      Exceptions
      Traits
      Constants
      (C++11)
      Regex Grammar
       
       
      int compare(const sub_match& m)const;
      (1)(since C++11)
      int compare(const string_type& s)const;
      (2)(since C++11)
      int compare(const value_type* c)const;
      (3)(since C++11)
      1) Compares twosub_matches directly by comparing their underlying character sequences. Equivalent tostr().compare(m.str()).
      2) Compares asub_match with astd::basic_string. Equivalent tostr().compare(s).
      3) Compares asub_match with a null-terminated sequence of the underlying character type pointed to bys. Equivalent tostr().compare(c).

      Contents

      [edit]Parameters

      m - a reference to another sub_match
      s - a reference to a string to compare to
      c - a pointer to a null-terminated character sequence of the underlyingvalue_type to compare to

      [edit]Return value

      A value less than zero if thissub_match isless than the other character sequence, zero if the both underlying character sequences are equal, greater than zero if thissub_match isgreater than the other character sequence.

      [edit]Notes

      This function is infrequently used directly by application code. Instead, one of the non-member comparison operators is used.

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      compares two strings
      (public member function ofstd::basic_string<CharT,Traits,Allocator>)[edit]
      converts to the underlying string type
      (public member function)[edit]
      (removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)
      compares asub_match with anothersub_match, a string, or a character
      (function template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/regex/sub_match/compare&oldid=178362"

      [8]ページ先頭

      ©2009-2025 Movatter.jp