Andre Poenitz <[EMAIL PROTECTED]> writes:

| On Tue, Mar 12, 2002 at 03:42:25PM +0100, Lars Gullik Bjønnes wrote:
>> | Because the 'body' will get too ugly for my taste...
>> 
>> What body?
>> can't you just post the function is question here?
>
>
| void MathCursor::touch()
| {
|       cursor_type::const_iterator it = Cursor_.begin();
|       cursor_type::const_iterator et = Cursor_.end();
|       for ( ; it != et; ++it)
|               it->xcell().touch();
| }
>
| I can't see a way to make this simpler using std::for_each

Perhaps not...

        struct temp_func {
               operator()(cursor_type::value_type & vt) {
                  vt.xcell().touch();
               }
        };

        for_each(Cursor_.begin(), Cursor_.end(), temp_func());

does not exacly make things easier, I agree on that.

a lambda lib would probably solve it:

        for_each(Cursor_.begin(), Cursor_.end(), _1.xcell().touch());

perhaps. Let's wait and see when Boost adds a lambda lib.

-- 
        Lgb

Reply via email to