Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2003-07-06 09:19:50


> > I don't know about the other libraries? Is there a standard for this in
> > boost or is it up to the libraries? Should they be commonised?

Thorsten Ottosen wrote
 
> Ideally, yes. I would prefer .c_str() for const char* conversion and
> str() for std::string

In date-time there are several 'to_string' functions that provide
different ouput formats so a single 'str()' method isn't going
to be enough. As for c_str(), you can use this once you have
std::string. From my view there is no point in trying to force
fit this functionality into an inadequate interface. Finally,
by keeping these as free functions dates and times can be used
without including I/O headers which the 'to_string' functions
use.

Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk