BloombergLP::bslstl::StringRefImp_CompareUtil::compare

Lexicographically compare string object a with C-string b.

Synopsis

Declared in <bslstl_stringref.h>

template<class CHAR_TYPE>
static
int
compare(
    StringRefImp<CHAR_TYPE> const& a,
    CHAR_TYPE const* b);

Description

Compare the specified string object a with the specified null-terminated C-string b using a lexicographical comparison and return a negative value if a is less than b, a positive value if a is greater than b, and 0 if a is equal to b.

Return Value

negative, zero, or positive comparison result

Parameters

NameDescription
astring object to compare
bnull-terminated C-string to compare against