Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-09-28 01:37:37


Gennadiy Rozental wrote:

>> I've taken Richard Johnson's glob_iterator that he posted to the list
>> back in January and re-written it completely, using Boost.Spirit to
>> transform the input 'glob' into an equivalent regex. The result is a
>> 'boost::glob' function that I believe is fully POSIX-conformant.
>>
>> Example usage:
>>
>> fs::path const starting_directory(".");
>> std::list<fs::path> const matches =
>> boost::glob("../te?t/foo*bar", starting_directory);
>
> This look way too inefficient. Why would you want to copy list of complex
> objects?

Maybe, we can just decide that all reasonable compilers support NRVO, and
stop worring about returning vectors/list by value? At least, when I write
function which returns a vector, I start it with

  vector<...> result;

so NRVO would surely work. The primary reason for 'result' is that I like
all functions to have a single return, but as a side effect it make NRVO
always working.

- Volodya


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