From: Rodrigo M. <rod...@gm...> - 2008-11-03 19:29:10
|
On Mon, Nov 3, 2008 at 3:32 AM, Dean Michael Berris <mik...@gm...>wrote: > Hi Rodrigo, > > On Mon, Nov 3, 2008 at 8:14 AM, Rodrigo Madera <rod...@gm...> > wrote: > > > > Basically I see three std::string elements in the message which already > make > > it strange. > > Why is this strange? > > > Is there a reason for them that I don't realize? > > std::string is the easiest container to use that allows both string > semantics and guarantee of contiguous storage (at least as far as I > understand). Any other container would be too unwieldy to use > especially for algorithms that deal with strings of characters. > > BTW, strings can contain binary data just fine (as long as you store > the data (7-bit chars) as is). > So are you saying that storing a binary block of data (say an image) into a string is okay? Boost has a buffer class made for this. If you want integration with boost you need to use boost. It makes no sense at all to put strings into every message. Regards, Rodrigo |