Ask questionsChanging SizeType to size_t across project

Any place in our project where we use rapidjson, we include the rapidson headers that are needed. We have probably 40 files that include it. According the documentation, it looks like if we want to use size_t for SizeType, we would have to add a define and the struct definition for the type. This seems error prone, as you could end up using different types for SizeType in different files.

I suppose we could have our own "project_rapidjson.h" file that we would include anywhere we use rapidjson, and remember to include it first, but it also might make sense for there to be a #define for at least the use of std::size_t, since it's common. Then the macro could be used when setting up your project, instead of everywhere.

Maybe a RAPIDJSON_USE_SIZET? Thoughts?


Answer questions miloyip

You may change the compilation options in a project to define macro globally.


Related questions

是否支持流式解析以及多个json分离解析 hot 1
是否支持流式解析以及多个json分离解析 hot 1
RapidJSON causes cc1plus: internal compiler error: Segmentation fault - rapidjson hot 1
GenericMemberIterator::Iterator implicitly declared private when RAPIDJSON_NOMEMBERITERATORCLASS is defined hot 1
Always gets a core dump while creating json string (rapidjson) hot 1
Bazel Support hot 1
Syntax typo in tutorial hot 1
是否支持流式解析以及多个json分离解析 hot 1
作者你好,我 想请教一下,这个框架是否能够将变量中文stirng 转成wchar_t? 在文档只看到定量 hot 1
travis on windows hot 1
Added headers to my project and got thousands of errors hot 1
Added headers to my project and got thousands of errors hot 1
想要的反斜杠 \. 无法表示,否则JSON解析出错 hot 1
Assertion `stack_.GetSize() == sizeof(ValueType)' failed hot 1
Github User Rank List