Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-07-08 12:41:02


Rob Stewart wrote:
> From: Thorsten Ottosen <nesotto_at_[hidden]>
>> Jonathan Turkanis <technews <at> kangaroologic.com> writes:
>>
>>> sure that the analogy with the iterators library will be very
>>> effective in helping users understand these templates. As a result,
>>> I'm think of using the less technical-sounding names
>>> "generic_streambuf" and "generic_stream."
>>>
>>> What do people think?
>>
>> seems ok. have you considered
>
> Hmmm. I agree that the original names are misleading. They
> don't create a facade over another class, they are provide the
> functionality directly. However, "generic_streambuf" sounds too,
> well, generic.

Meaning the names are pretty dull? Thats true. I guess I could call them
platinum_stream and platinum_streambuf ;-)

>> basic_streambuf<>
>> basic_stream<>
>>
>> as an analogy with regex/string etc ?
>
> As compared to std::basic_istream et al, these classes are hardly
> what one would call basic. They push the concepts far forward.
> Thus, should these classes be standardized, std::basic_stream
> doesn't stand apart from the other class templates.

I agree. And basic_streambuf is already used by the standard.

I'd rather not declare a type in a boost namespace with the same unqualified
name as a type in namespace std, unless the type is recommended as a replacement
for the standard type. For example, I define a template
boost::iostreams::char_traits which is like std::char_traits except it supports
would_block in addition to eof.

> Furthermore,
> they aren't specialized on the character type as those other
> templates are, so they deserve different names.
>
> Is there are reason not to call them simply "stream" and
> "streambuf?"

I like these, except that streambuf is a typedef in namespace std for
basic_streambuf<char>.

> If you're concerned about the possibility of
> typedefs or other uses of those names in either the std or boost
> namespace, then how about "policy_stream" and "policy_streambuf?"

These are very good, but I've tenatively decided to downplay the policy-based
aspect of the design. I know at least one person who was turned off by the
description of the library as involving policies. While I disagree with his
view, and I hope he is not representive of users in general, his reaction made
me realize that calling the library policy-based doesn't really add much.

Still, I like these names, and will think about using them.

>>> I'm thinking of renaming the headers that are curently based on
>>> component names so that all headers will have short, simple names.
>>> E.g.,
>>>
>>> bzip2.hpp
>>> counter.hpp
>>> gzip.hpp
>>> line.hpp
>>> newline.hpp
>>> one_step.hpp
>>> regex.hpp
>>> stdio.hpp
>>> symmetric.hpp
>>> test.hpp
>>> zlib.hpp
>>>
>>> Thoughts?
>>
>> I like you renaming.
>
> Seems reasonable given that they are already in the filter
> subdirectory.

Okay, thanks.

Jonathan


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