mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Fix the templated visitor in Vst3MessageHandler
Now it works as expected, since auto can't be initialized to multiple different values.
This commit is contained in:
@@ -179,17 +179,18 @@ class Vst3MessageHandler : public AdHocSocketHandler<Thread> {
|
|||||||
// We do the visiting here using a templated lambda. This way we
|
// We do the visiting here using a templated lambda. This way we
|
||||||
// always know for sure that the function returns the correct
|
// always know for sure that the function returns the correct
|
||||||
// type, and we can scrap a lot of boilerplate elsewhere.
|
// type, and we can scrap a lot of boilerplate elsewhere.
|
||||||
const auto& response = std::visit(
|
std::visit(
|
||||||
[&]<typename T>(const T object) ->
|
[&]<typename T>(const T object) {
|
||||||
typename T::Response { return callback(object); },
|
typename T::Response response = callback(object);
|
||||||
|
|
||||||
|
if (logging) {
|
||||||
|
auto [logger, is_host_vst] = *logging;
|
||||||
|
logger.log_response(!is_host_vst, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
write_object(socket, response);
|
||||||
|
},
|
||||||
request);
|
request);
|
||||||
|
|
||||||
if (logging) {
|
|
||||||
auto [logger, is_host_vst] = *logging;
|
|
||||||
logger.log_response(!is_host_vst, response);
|
|
||||||
}
|
|
||||||
|
|
||||||
write_object(socket, response);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this->receive_multi(logging
|
this->receive_multi(logging
|
||||||
|
|||||||
Reference in New Issue
Block a user