Skip to content

Why not allowing to parse null as std::optional in yaml files via is_empty(null) -> true #652

@Fellfalla

Description

@Fellfalla

Hey,

i was interested in explicitly point out "null" for std::nullopt values inside yaml files.
Would there a specific reason against applying this patch

--- a/include/rfl/yaml/Reader.hpp
+++ b/include/rfl/yaml/Reader.hpp
@@ -68,7 +68,7 @@
   }

   bool is_empty(const InputVarType& _var) const noexcept {
-    return !_var.node_ && true;
+    return !_var.node_ || _var.node_.IsNull();
   }

   template <class T>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions