Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2005-07-14 09:01:56


From: "Jonathan Turkanis" <technews_at_[hidden]>
> Sylvester-Bradley, Gareth wrote (in private email):
> > Jonathan Turkanis wrote:
>
> > I guess streambuf_wrapper / stream_wrapper suffer from the same lack of
> > to/from clarity as streambuf_adapter / stream_adapter?
>
> To me they sound unambiguous, but with the wrong meaning.

I'm not sure which you were saying had the wrong meaning, but I
thought about streambuf_adapter/stream_adapter, and I think those
are great names. The class templates are adapting a Device type
to be another type--a streambuf or stream--like those in
namespace std.

> > Can I offer another suggestion, taking inspiration from several other Boost
> > libraries, like enable_if, result_of, etc?
> >
> > How about streambuf_from / stream_from (or _with, _of, _on, _over, ...)?
>
> Iostreams also uses this type of name: category_of, char_type_of and mode_of.
>
> streambuf_from / stream_from look pretty good when they are specialized:
>
> streambuf_from<array>
> stream_from<socket>

That sounds a little weird, but it isn't terrible. Oh, I just
came back to this part because I realized what didn't sound
right: these are class templates, not function templates, yet
"from" suggests a return value to me.

> but I'm afraid they will look funny in documentation. E.g.,
>
> The fundamental component provided by the Iostreams library
> is the class template streambuf_from, a derived class of
> std::basic_streambuf which performs i/o by delegating to a
> contained Device.

There are lots of names that don't flow well in a description
like that. I don't think that should interfere too much with
name selection.

-- 
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