[C++-sig] Some thoughts on py3k support

Rene Rivera grafikrobot at gmail.com
Wed Mar 18 00:25:38 CET 2009


Matthew Scouten (TT) wrote:
> I can work with whatever you come up with, but it might convenient if a
> char* or char[] was treated as a bytes object and a std::string was
> treated as a string. Thoughts? 

A char* can never be fully treated as a bytes object. You must mean a 
char* plus a size_t (or two char* iterator pointers). At which point any 
convenience you think you are getting from treating char* as bytes is 
gone as you have to introduce an intermediate type anyway to put in the 
"buffer" semantics. Hence you are better off with real buffer objects, 
or equivalents thereof. Say a std::pair<char*,char*> iterator range, or 
std::vector<char>, etc.


-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org (msn) - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim,yahoo,skype,efnet,gmail


More information about the Cplusplus-sig mailing list