Boost logo

Boost :

Subject: Re: [boost] [strings][unicode] Proposals for Improved String Interoperability in a Unicode World
From: Keith Burton (kb_at_[hidden])
Date: 2012-01-29 03:21:55

-----Original Message-----
These proposals are the Boost version of the TR2 proposals made in
N3336, Adapting Standard Library Strings and I/O to a Unicode World.

I'm very interested in hearing comments about either the Boost or the
TR2 proposal

-----Original Message-----


I do not understand how the converting c_str template can be useful in what
for me, is the normal usage of the c_str function.

Given existing code

std::string stdstr;
const char * cstr = stdstr.c_str();

third_party_api( cstr );

and moving to general use of a wide string type e.g.

std::u32string stdstr;
const char * cstr = stdstr.c_str< char >(); // ?????????

third_party_api( cstr );

clearly it is possible to make third_part_api( stdstr.c_str< char
>.c_str() ) work but surely that would also permit the above invalid use.

Keith Burton

Boost list run by bdawes at, gregod at, cpdaniel at, john at