I just read some recommendations on using
std::string s = get_string();
std::string t = another_string();
if( !s.compare(t) )
if( s == t )
This is what the standard has to say about
template<class charT, class traits, class Allocator> bool operator==(const basic_string<charT,traits,Allocator>& lhs, const basic_string<charT,traits,Allocator>& rhs) noexcept;
Returns: lhs.compare(rhs) == 0.
Seems like there isn't much of a difference!