Syopain

Results 10 comments of Syopain

Because of floating point error, the compare of equality of floating point numbers is unreliable.

@keithnull strtod的实现应该是逐位计算的,所以计算过程中可能会有误差,我觉得这里应该用`fabs(expect - actual) < (EPS)` 来比较

> > @keithnull strtod的实现应该是逐位计算的,所以计算过程中可能会有误差,我觉得这里应该用`fabs(expect - actual) < (EPS)` 来比较 > > @Syopain You are right. But how to explain that `(double)3.14156 == strtod("3.14156")` works while `3.14156 == strtod("3.14156")` not? I...

> Json::operator=(const Json &rhs)和Json& Json::operator=(Json &&rhs) noexcept的实现中是不是都缺少 return *this 确实遗漏了,感谢指正

都可以,vector初始化和插入更快,map访问更快

好的,有空的时候会完善下

@aixi union有类成员时确实实现比较复杂,但用union版本依赖低一点吧

@KeepStudyingAhead 这里用Pimpl手法把Json类的实现隐藏在json::Value类中,Json::get_array_element(index)通过调用实现类的get_array_element函数,但两个函数的返回类型不同,所以不能直接return v->get_array_element,要做一次转换。而其他像string、number等类型就可以直接返回。