Boost logo

Boost Users :

From: Pavol Droba (droba_at_[hidden])
Date: 2008-04-08 09:43:47


Hi,

is_iequal is an element-comparisom predicate. In other words, it is used to compare characters.
It is used as a plug-in to other generic algorithms.

If you'd like to compare strings, use boost::iequals algorithm. Or have a look here for
more options:

http://www.boost.org/doc/libs/1_34_1/doc/html/string_algo/reference.html#header.boost.algorithm.string.predicate.hpp

Best regards,
Pavol.

Ovanes Markarian wrote:
> Hello *,
>
> I have a question regarding string comparisons. Are the comparisons
> below suppose to work in VC 7.1 boost 1.34.0?
>
> Case 1:
> bool is_test_string(std::string const& str)
> {
> std::string const& compare_with=std::string("test_string");
>
> boost::algorithm::is_iequal comparator;
>
> return comparator(str, compare_with);
> }
>
>
> Case 2:
> bool is_test_string(std::string const& str)
> {
> char const* compare_with = "test_string";
>
> boost::algorithm::is_iequal comparator;
>
> return comparator(str, compare_with);
> }
>
>
> Case 3:
> bool is_test_string(std::string const& str)
> {
> boost::algorithm::is_iequal comparator;
>
> return comparator(str, "test_string");
> }
>
> In all 3 cases I receive compiler erros.
>
> Many thanks,
> Ovanes
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net