Angus Leeming <[EMAIL PROTECTED]> writes:

| Incidentally, in FormSendto.C I have:
>
|       vector<string>::iterator result = keys.begin();
|       vector<Format const *>::const_iterator it  = all_formats_.begin();
|       vector<Format const *>::const_iterator end = all_formats_.end();
|       for (; it != end; ++it, ++result) {
|               *result = (*it)->prettyname();
|       }
| Is there an STL function that would do this. There doesn't seem to be a 
| std::copy_if (and lyx::copy_if is misnamed IMO, or at least confusing.)

transform perhaps

          std::transform(it, end, result, std::mem_fun(&Format::prettyname));

something.

but it is made a put more difficult since you store a pointer in the
vector.

-- 
        Lgb

Reply via email to