Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2005-01-05 15:05:58


From: Beman Dawes <bdawes_at_[hidden]>
>
> 1. Hard-wired byte_string type in wstring_convert
> -------------------------------------------------
>
> If this suggested change is accepted, it will probably make sense to rename
> some wstring_convert members.

You'll probably need to enumerate the changes you think are
necessary to ensure good names are selected.

> 3. Need target-argument form for wstring_convert conversion functions
> ---------------------------------------------------------------------
>
> wstring_convert's conversion functions are in the form:
>
> byte_string to_bytes(const wide_string& wstr) const;
>
> While this form is often useful and should be retained, it may imply an
> extra copy of the result if a compiler is not smart enough to optimize the
> copy away.
> Suggested change is to add additional functions in the form:
>
> void to_bytes(const wide_string& wstr, byte_string & target) const;

I prefer output parameters to be first (due to the occasional
need to have defaulted parameters and the desire to find output
parameters in the same position relative to input parameters).
Thus, without meaning to trigger a religious war, I propose this
version instead:

   void to_bytes(byte_string & destination,
      wide_string const & source) const;

> 4. More explicit name for wstring_convert
> -----------------------------------------
>
> "wstring" might be misleading, depending on the actual types involved.
> "convert" is a verb, yet nouns make better class names.
>
> Suggested change:
> wstring_convert
> to:
> string_converter

Much better.

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

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