Add support for union leafs
Change-Id: Ifc1a53eed2c059f6fe5d75544ecaa3e63028f78f
diff --git a/src/leaf_data.hpp b/src/leaf_data.hpp
index 7139fc4..1c4176e 100644
--- a/src/leaf_data.hpp
+++ b/src/leaf_data.hpp
@@ -173,6 +173,12 @@
{
return std::visit(*this, *leafRef.m_targetType);
}
+ bool operator()(const yang::Union& unionInfo) const
+ {
+ return std::any_of(unionInfo.m_unionTypes.begin(), unionInfo.m_unionTypes.end(), [this](const auto& type) {
+ return std::visit(*this, type);
+ });
+ }
};
struct LeafData : x3::parser<LeafData> {