这主要是由json_parser_read.hpp里面的一个bug造成的,修改如下代码:     

   struct a_unicode

        {
            context &c;
            a_unicode(context &c): c(c) { }
            void operator()(unsigned long u) const
            {
                //u = (std::min)(u, static_cast<unsigned long>((std::numeric_limits<Ch>::max)()));


                typedef typename std::make_unsigned<Ch>::type UCh;
                u = (std::min)(u, static_cast<unsigned long>((std::numeric_limits<UCh>::max)()));


                c.string += Ch(u);
            }

        };

如上修改在xcode和visual studio环境下编译正常,但在gcc环境下,可能需要修改typedef typename std::make_unsigned<Ch>::type UCh;为typedef typename make_unsigned<Ch>::type UCh;

GitHub 加速计划 / js / json
41.72 K
6.61 K
下载
适用于现代 C++ 的 JSON。
最近提交(Master分支:1 个月前 )
960b763e 2 个月前
8c391e04 5 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐