|
Boost : |
From: amerio (amerio_at_[hidden])
Date: 2003-04-08 06:54:57
Hi,
I'm trying to put a parsed file into a std::string
typedef file_iterator <char> IteratorT;
parse_info <IteratorT> _Info = parse (_Start,_End,_Rule [&Echo]);
void Echo (IteratorT const & rBegin, IteratorT const & rEnd)
{
string s0(rBegin, rEnd); // <<-- this produces garbage !!!
std::cout << s0 << endl;
string s1; for_each(rBegin, rEnd, append(s1)); // <<-- this works as
expected
std::cout << s1 << endl;
}
I don't understand why string s0(rBegin, rEnd) does not work with
file_iterator.
It does work with "standard" iterator, so...
Maybe I overlooked something ?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk