Replace std::monostate with std::nullptr_t

This represents the underlying meaning better since we're mostly dealing
with the `data` void pointer argument.
This commit is contained in:
Robbert van der Helm
2020-04-19 16:02:01 +02:00
parent 717ffb719d
commit 9f3ed85208
4 changed files with 7 additions and 10 deletions
+3 -3
View File
@@ -236,7 +236,7 @@ void passthrough_event(boost::asio::local::stream_protocol::socket& socket,
// because it was not zeroed out by the host) for an event that should
// report some data back?
const auto response_data = std::visit(
overload{[&](auto) -> EventResposnePayload { return std::monostate(); },
overload{[&](auto) -> EventResposnePayload { return nullptr; },
[&](const AEffect& updated_plugin) -> EventResposnePayload {
// This is a bit of a special case! Instead of writing some
// return value, we will update values on the native VST
@@ -261,7 +261,7 @@ void passthrough_event(boost::asio::local::stream_protocol::socket& socket,
plugin->uniqueID = updated_plugin.uniqueID;
plugin->version = updated_plugin.version;
return std::monostate();
return nullptr;
},
[&](WantsChunkBuffer&) -> EventResposnePayload {
// In this case the plugin will have written its data
@@ -290,7 +290,7 @@ void passthrough_event(boost::asio::local::stream_protocol::socket& socket,
const auto time_info =
reinterpret_cast<const VstTimeInfo*>(return_value);
if (time_info == nullptr) {
return std::monostate{};
return nullptr;
} else {
return *time_info;
}