mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-03 15:43:50 +01:00
TranslatableString::Format is aware of std::reference_wrapper
This commit is contained in:
@@ -501,6 +501,13 @@ private:
|
||||
|
||||
template< typename T > static const T &TranslateArgument( const T &arg, bool )
|
||||
{ return arg; }
|
||||
// This allows you to wrap arguments of Format in std::cref so that they
|
||||
// are captured (as if) by reference rather than by value
|
||||
template< typename T > static auto TranslateArgument(
|
||||
const std::reference_wrapper<T> &arg, bool debug )
|
||||
-> decltype(
|
||||
TranslatableString::TranslateArgument( arg.get(), debug ) )
|
||||
{ return TranslatableString::TranslateArgument( arg.get(), debug ); }
|
||||
static wxString TranslateArgument( const TranslatableString &arg, bool debug )
|
||||
{ return arg.DoFormat( debug ); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user