I'm trying to compare libpqxx c_str
values.
If I try to compare them directly, result1[0][0].c_str() == result2[0][0].c_str()
, for example, they do not return true
when they have the same string values. The only way to compare them properly is to use strcmp
.
However, if I'm comparing a libpqxx c_str
to a std::string
with strcmp
, the compiler complains that an argument of strcmp
cannot be a std::string
, yet most strangely of all to me: if I compare something like result1[0][0].c_str() == some_std_string
, the comparison will return true
if they possess the same value, false
otherwise.
Why is this? Is this something particular to libpqxx? If not, is this standard behavior?