Use perfect forwarding in templates where possible

This commit is contained in:
Robbert van der Helm
2021-05-17 01:02:45 +02:00
parent 883b6b7700
commit e974d1d2b1
5 changed files with 31 additions and 31 deletions
+2 -2
View File
@@ -210,13 +210,13 @@ class Vst3PluginBridge : PluginBridge<Vst3Sockets<std::jthread>> {
* @see Vst3PlugViewProxyImpl::run_gui_task
*/
template <typename F>
bool maybe_run_on_mutual_recursion_thread(F& cb) {
bool maybe_run_on_mutual_recursion_thread(F& fn) {
// We're handling an `F&` here because we cannot copy a
// `packged_task()`, and we need to be able to move that actual task
std::unique_lock mutual_recursion_lock(mutual_recursion_contexts_mutex);
if (!mutual_recursion_contexts.empty()) {
boost::asio::dispatch(*mutual_recursion_contexts.back(),
std::move(cb));
std::move(fn));
return true;
} else {
return false;