Move get_request_variant template function

This needs to be specialized for the CLAP and VST3 request variant
types.
This commit is contained in:
Robbert van der Helm
2022-08-23 18:53:38 +02:00
parent 9edb4aa567
commit 5b4dbdd890
2 changed files with 30 additions and 27 deletions
+12
View File
@@ -1150,3 +1150,15 @@ class TypedMessageHandler : public AdHocSocketHandler<Thread> {
process_message);
}
};
/**
* Get the actual variant for a request. We need a function for this to be able
* to handle composite types, like `AudioProcessorRequest` that use
* `MesasgeReference` to be able to store persistent objects in the message
* variant. This function should be specialized for those kinds of types.
*/
template <typename... Ts>
std::variant<Ts...>& get_request_variant(
std::variant<Ts...>& request) noexcept {
return request;
}