
On Jul 5, 2006, at 10:15 PM, boost-request@lists.boost.org wrote:
std::string s = get_some_utf_8_xml_data();
utf_range r = boost::find(utf_range(s), UL0x0000FEFF);
assert(*r.begin().base() == U0xEF);
Not sure why find would return a range - but so long as I can also use it with standard algorithms, and it generates efficient code I'm happy. Sean

Sean Parent wrote:
On Jul 5, 2006, at 10:15 PM, boost-request@lists.boost.org wrote:
std::string s = get_some_utf_8_xml_data();
utf_range r = boost::find(utf_range(s), UL0x0000FEFF);
assert(*r.begin().base() == U0xEF);
Not sure why find would return a range - but so long as I can also use it with standard algorithms, and it generates efficient code I'm happy.
I recall the discussion about what range-algorithms should return. My current answer is: std::string src("abcdefghijk"); namespace ph = boost::phoenix; // version2 { std::string s1("efg"); BOOST_CHECK(( equals( std::string("efghijk"), src|applied(ph::search(rng1, s1), end) ) )); } Users specify it by using lambda expression. -- Shunsuke Sogame
participants (2)
-
Sean Parent
-
Shunsuke Sogame