Boost logo

Boost :

Subject: [boost] Iterator Range and operator==
From: Olaf van der Spek (ml_at_[hidden])
Date: 2012-04-20 08:15:50


What do you expect this code to do? Is b true or false? And why?
Is this expected behaviour?

#include <boost/range/iterator_range.hpp>
#include <string>

int main()
        std::string s = "Olaf";
        boost::iterator_range<std::string::iterator> r(s);
        bool a = r == s;
        bool b = r == "Olaf";
        return 0;


Boost list run by bdawes at, gregod at, cpdaniel at, john at