Boost logo

Boost :

From: Mark Rodgers (mark.rodgers_at_[hidden])
Date: 2000-05-11 04:43:34


From: Dave Abrahams <abrahams_at_[hidden]>
>A colleague of mine remarks: "The first thing I see is that the argument
to
>basic format should be const charT*."

Or just do away with the ca parameter and make fmt the parameter, so
instead of

    template<typename A>
    basic_format(charT* ca, A a)
      : w_(0), a_('r')
    {
      std::basic_string<charT, Traits> fmt(ca);
      ...

perhaps

    template<typename A>
    basic_format(std::basic_string<charT, Traits> fmt, A a)
      : w_(0), a_('r')
    {
      ...

If someone happened to have a format in a std::string, then they could
just pass it on instead of having to call c_str().

I also wondered why all the other parameters were passed by value. Maybe
that should be

    template<typename A>
    basic_format(std::basic_string<charT, Traits> fmt, const A &a)
       : w_(0), a_('r')
    {
       ...

I also don't like the implicit conversion std::basic_string. Is that
needed?

Mark


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