std::sub_match<BidirIt>::compare
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Text processing library
Regular expressions library (C++11)
Formatting library (C++20)
(C++17)
(C++17)
(C++17)
(C++17)
(C++17)
(C++26)
Regular expressions library
Classes
(C++11)
(C++11)
(C++11)
Algorithms
(C++11)
(C++11)
(C++11)
Iterators
(C++11)
(C++11)
Exceptions
(C++11)
Traits
(C++11)
Constants
(C++11)
(C++11)
(C++11)
Regex Grammar
(C++11)
std::sub_match
Member functions
sub_match::compare
Non-member functions
(until C++20)(until C++20)(until C++20)(until C++20)(until C++20)(C++20)
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 two
sub_match
es directly by comparing their underlying character sequences. Equivalent to str().compare(m.str()).3) Compares a
sub_match
with a null-terminated sequence of the underlying character type pointed to by s. Equivalent to str().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 underlying
value_type
to compare to
[edit] Return value
A value less than zero if this sub_match
is less than the other character sequence, zero if the both underlying character sequences are equal, greater than zero if this sub_match
is greater 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
Reason: no example
[edit] See also
(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(removed in C++20)(C++20)
sub_match
with another sub_match
, a string, or a character (function template) [edit]