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.


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -