1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-21 14:02:57 +02:00

Define and use utilities transform_range, transform_container

This commit is contained in:
Paul Licameli
2019-02-25 12:50:33 -05:00
parent b0738f6e09
commit 52642e49a5
4 changed files with 29 additions and 25 deletions

View File

@@ -111,20 +111,13 @@ private:
auto ODDecodeFFmpegTask::FromList( const TrackHolders &channels ) -> Streams
{
Streams streams;
streams.reserve(channels.size());
using namespace std;
transform(channels.begin(), channels.end(), back_inserter(streams),
// Convert array of array of unique_ptr to array of array of bare pointers
return transform_container<Streams>( channels,
[](const NewChannelGroup &holders) {
Channels channels;
channels.reserve(holders.size());
transform(holders.begin(), holders.end(), back_inserter(channels),
mem_fn(&NewChannelGroup::value_type::get)
);
return channels;
return transform_container<Channels>( holders,
std::mem_fn(&NewChannelGroup::value_type::get) );
}
);
return streams;
}
//------ ODDecodeFFmpegTask definitions