Boost logo

Boost :

From: elviin (elviin_at_[hidden])
Date: 2006-04-26 06:14:30


Hello,

I'm not sure if it is still topic but here is the minimum code to
reproduce the problem.

[----CODE----]

#include <string>
#include <algorithm>

int main()
{
    std::string par
        ( "produces help message slkfjsd lskdjf slkjf sdlkfj sdlkfj
sdlkfj sdf lksdj" );
    unsigned int line_length = 79, indent = 33;

    std::string::const_iterator line_begin = par.begin();
    std::string::const_iterator line_end = line_begin + (line_length - indent);

    // find last ' ' in the second half of the current paragraph line

    std::string::const_iterator last_space =
        std::find(std::reverse_iterator<std::string::const_iterator>(line_end
- 1),
        std::reverse_iterator<std::string::const_iterator>(line_begin - 1),
             ' ')
        .base();

    return 0;
}

Regards,
Elviin


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk