1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-04 17:49:45 +02:00

More comments explaining the C++11 exotica

This commit is contained in:
Paul Licameli 2018-10-21 12:46:41 -04:00
parent f70c76de83
commit d40dfa2de2

View File

@ -460,9 +460,14 @@ namespace MenuTable {
Append( std::forward<Args>(moreArgs)... );
};
// Move one unique_ptr to an item into our array
void AppendOne( BaseItemPtr&& ptr );
// This override allows a lambda or function pointer in the variadic
// argument lists without any other syntactic wrapping:
// This overload allows a lambda or function pointer in the variadic
// argument lists without any other syntactic wrapping, and also
// allows implicit conversions to type Factory.
// (Thus, a lambda can return a unique_ptr<BaseItem> rvalue even though
// Factory's return type is shared_ptr, and the needed conversion is
// appled implicitly.)
void AppendOne( const Factory &factory )
{ AppendOne( std::make_unique<ComputedItem>( factory ) ); }
};