c++ - conversion from 'size_t' to 'rapidjson::SizeType' -
i have c++ example code: void test() { rapidjson::document doc; doc.setobject(); const std::string source = "the quick brown fox jumps on lazy dog"; rapidjson::value source_val; source_val.setstring( source.c_str(), source.length(), doc.getallocator() ); } and @ compile time, on x64 platform, warning: warning c4267: 'argument': conversion size_t rapidjson::sizetype , possible loss of data how can correctly convert string's length ( size_t ) rapidjson sizetype? per documentation : rapidjson uses 32-bit array/string indices on 64-bit platforms, instead of using size_t . users may override sizetype defining rapidjson_no_sizetypedefine .