
On Mon, Jan 30, 2012 at 12:00 PM, Yakov Galka <ybungalobill@gmail.com> wrote:
On Sun, Jan 29, 2012 at 17:52, Beman Dawes <bdawes@acm.org> wrote: ...
While I'm totally convinced that conversion iterators would be very useful, the exact form is an open question. Could you be more specific about the details of your convert suggestion?
The point is that it's more like a free-standing c_str() you proposed. Unlike c_str() member function it would work on any character range, and returns a range of converting iterators. We don't need to extent basic_string for this, which is already too big.
The only way I can see that work with a totally unchanged basic_string would involve a temporary, which I was trying to avoid. Although with move semantics the temporary isn't as expensive as is used to be. If basic_string changed to accept range templates (which others may propose), a free-function approach would work (pending the details of the range proposal). If basic_string changed to accept single iterator templates, a free-function conversion iterator generator approach would work. I've added these three alternative solutions to the paper, and given you credit in the acknowledgments. Thanks! See http://beman.github.com/string-interoperability/tr2-proposal.html --Beman