|  | Home | Libraries | People | FAQ | More | 
Compare a string with the string.
template< [role red error.param neither has a declname nor a 'class ' prefix in the type][role red error.param neither has a declname nor a 'class ' prefix in the type][role red error.param neither has a declname nor a 'class ' prefix in the type][role red error.param neither has a declname nor a 'class ' prefix in the type]> constexpr int compare( size_type pos1, size_type count1, const T& t) const;
            Let s be string_view_type(t),
            sub be substr(pos1, count1),
            and comp be traits_type::compare(sub.data(), s.data(), std::min(sub.size(), s.size()).
            If comp !=
            0, then the result is comp. Otherwise, the result is 0 if sub.size() == s.size(),
            -1
            if sub.size() < s.size(), and 1
            otherwise.
          
Linear.
Strong guarantee.
| Type | Description | 
|---|---|
| 
                       | The type of the object to convert. | 
std::is_convertible<const T&, string_view>::value && !std::is_convertible<const T&, const_pointer>::value.
            The result of lexicographically comparing s
            and sub.
          
| Name | Description | 
|---|---|
| 
                       | The index at which to begin the substring. | 
| 
                       | The length of the substring. | 
| 
                       | The string to compare. |