mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-17 00:20:06 +02:00
TranslatableString::Format is aware of std::reference_wrapper
This commit is contained in:
parent
c2c308733b
commit
eba984303c
@ -501,6 +501,13 @@ private:
|
|||||||
|
|
||||||
template< typename T > static const T &TranslateArgument( const T &arg, bool )
|
template< typename T > static const T &TranslateArgument( const T &arg, bool )
|
||||||
{ return arg; }
|
{ 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 )
|
static wxString TranslateArgument( const TranslatableString &arg, bool debug )
|
||||||
{ return arg.DoFormat( debug ); }
|
{ return arg.DoFormat( debug ); }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user