Boost logo

Boost :

From: Martin Wille (mw8329_at_[hidden])
Date: 2003-11-11 17:43:16


Fredrik Blomqvist wrote:

> David Abrahams wrote:
>
>>Walter Landry <wlandry_at_[hidden]> writes:
>>
>
> [snip]
>
>>>I can't run std::sort() on those iterators.
>>
>> std::vector<path> v;
>> std::copy(directory_iterator(p), directory_iterator(),
>
> back_inserter(v));
>
>> std::sort(v.begin(), v.end());
>
>
> or even shorter:
> std::vector<path> v(directory_iterator(p), directory_iterator());

That would declare v as a function that returns a path.
You'd have to add () around one of the arguments to make
v a vector that is constructed by the two-iterator constructor.

Regards,
m


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