mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Fix typo in the in place std::variant<> extension
We of course want to do this for non-trivial types as mentioned in the comment above, not for trivial types...
This commit is contained in:
@@ -51,7 +51,7 @@ class InPlaceVariant : public StdVariant<Overloads...> {
|
|||||||
// Reinitializing nontrivial types may be expensive especially when
|
// Reinitializing nontrivial types may be expensive especially when
|
||||||
// they reference heap data, so if `data` is already holding the
|
// they reference heap data, so if `data` is already holding the
|
||||||
// requested variant then we'll deserialize into the existing object
|
// requested variant then we'll deserialize into the existing object
|
||||||
if constexpr (std::is_trivial_v<TElem>) {
|
if constexpr (!std::is_trivial_v<TElem>) {
|
||||||
if (auto item = std::get_if<TElem>(&data)) {
|
if (auto item = std::get_if<TElem>(&data)) {
|
||||||
this->serializeType(des, *item);
|
this->serializeType(des, *item);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user