At a prior job, people were using std::string to hold arbitrary binary
data, as opposed to vector<char>. I've seen a few people in this group
poopoo that notion, and I'd like to find out what they think the
pitfalls, if any, of using string to hold binary data are. I ask,
because otherwise the code base was pretty high quality, and string
does offer a number of extra search based member functions that vector
does not.
Additionally, is there any strong reason to use unsigned char as
opposed to char to hold binary data where the high order bit might be
set? Again, in practice I've mostly seen char used.
Thanks
--
[ See http://www.gotw.ca/resources/clcm.htm
for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


|