From: Glyn M. <gly...@gm...> - 2007-07-17 19:43:40
|
Guys, I've been giving a little thought to something Dean mentioned in his last message about using std::string in the network library. The first thing I thought of was that Dean stated that "everything is a template". Apart of course from std::string. I have created a branch in SVN named gxm) which replaces all references to std::string with an extra template parameter. Happily, this passes all the original tests (with an additional template specialization so that const char * is converted to a std::string). However, this creates a problem (certainly with GCC) because the wchar_t typedef is the same as char and its not possible to overload const wchar_t * in the same way. So the following code will not compile: wmessage wmsg; wmsg << header(L"wide characters"); Another thing I see is that boost filesystem and boost program_options have dealt with a very similar problem to this. But if we use the same approach (see the file "boost/detail/utf8_codecvt_facet.hpp" ) then we'd have to accept the use of a cpp source file, meaning we will no longer have a header only library. What do others think about this? G |