Is it neccessary to return optional<DataNode> from newPath methods? Is there any case where the returned node is NULL but the underlying lyd_new_path returns LY_SUCCESS? Also, we always check for std::nullopt in {DataNode,Context}::newPath and throw logic_error if that happens so it seems that we actually might want newPath to return just DataNode.
Is it neccessary to return
optional<DataNode>fromnewPathmethods? Is there any case where the returned node is NULL but the underlyinglyd_new_pathreturnsLY_SUCCESS? Also, we always check forstd::nulloptin{DataNode,Context}::newPathand throwlogic_errorif that happens so it seems that we actually might wantnewPathto return justDataNode.