Fix up a couple opaque value cases

Signed-off-by: Nicholas Van Sickle <nvsickle@amazon.com>
This commit is contained in:
Nicholas Van Sickle
2021-12-21 16:19:32 -08:00
parent 68c93273d6
commit deb3568aaa
2 changed files with 4 additions and 3 deletions
@@ -1042,7 +1042,7 @@ namespace AZ::Dom
const AZStd::any& Value::GetOpaqueValue() const
{
return *AZStd::get<AZStd::shared_ptr<AZStd::any>>(m_value);
return *AZStd::get<OpaqueStorageType>(m_value);
}
void Value::SetOpaqueValue(const AZStd::any& value)
@@ -1165,7 +1165,7 @@ namespace AZ::Dom
result = visitor.EndNode(object.size(), arrayContainer.size());
}
}
else if constexpr (AZStd::is_same_v<Alternative, AZStd::any>)
else if constexpr (AZStd::is_same_v<Alternative, OpaqueStorageType>)
{
result = visitor.OpaqueValue(*arg);
}
+2 -1
View File
@@ -158,6 +158,7 @@ namespace AZ::Dom
using ShortStringType = AZStd::fixed_string<ShortStringSize>;
using SharedStringContainer = AZStd::vector<char>;
using SharedStringType = AZStd::shared_ptr<const SharedStringContainer>;
using OpaqueStorageType = AZStd::shared_ptr<AZStd::any>;
//! The internal storage type for Value.
//! These types do not correspond one-to-one with the Value's external Type as there may be multiple storage classes
@@ -184,7 +185,7 @@ namespace AZ::Dom
// Node
NodePtr,
// Opaque
AZStd::shared_ptr<AZStd::any>>;
OpaqueStorageType>;
// Constructors...
Value();