-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: new APIs of merge, diff and update #38
base: master
Are you sure you want to change the base?
Conversation
using alloc_type = | ||
typename NodeTraits<NodeType>::alloc_type; ///< Dervied class allocator | ||
///< type. | ||
using Allocator = alloc_type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allocator 名字和 alloc_type 重复
include/sonic/dom/genericnode.h
Outdated
typename std::enable_if<is_base_of_template<T, GenericNode>::value && | ||
is_base_of_template<P, GenericNode>::value, | ||
bool>::type = false> | ||
static inline void Merge(T& original, const P& patch, Allocator& alloc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可能做出 genericnode的成员函数会比较好?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GenericNode里提供了 MergePatch 的方法,实现了 Merge 的语义
include/sonic/dom/genericnode.h
Outdated
typename std::enable_if<is_base_of_template<T, GenericNode>::value && | ||
is_base_of_template<S, GenericNode>::value, | ||
bool>::type = false> | ||
static inline void Update(T& original, const S& src, Allocator& alloc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不用模板参数,使用 inherit 命名?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有必要吧,两者逻辑差不多,只有些微区别。额外添加一个函数反而维护起来很麻烦。
Remove diff API. |
14ce2e2
to
6e4a0ed
Compare
Main Changes