id summary reporter owner description type status milestone component version severity resolution keywords cc 2403 Conversion of fixed size char array by lexical_cast Chard nasonov "I can't say if this counts as a bug, since it is very contrived, but it does have a possibly unintended side-effect. If ''lexical_cast'' is used to convert a fixed size char array, it will happily compile but, it will be treated as a null-terminated char array. This means it will run off the end of the fixed length array. E.g. {{{ struct Data { Data() { fixedLengthField[0] = '0'; fixedLengthField[1] = '1'; fixedLengthField[2] = '2'; fixedLengthField[3] = '3'; moreData[0] = 'X'; moreData[1] = '\0'; } // pack(1) char fixedLengthField[4]; char moreData[2]; }; void test() { Data d; std::string x = boost::lexical_cast(d.fixedLengthField); assert(x.size() == sizeof(d.fixedLengthField)); } }}} " Bugs closed lexical_cast Boost 1.34.1 Problem wontfix lexical_cast fixed char array