Boost logo

Boost :

From: bill_kempf (williamkempf_at_[hidden])
Date: 2002-01-31 13:49:31


--- In boost_at_y..., "David Abrahams" <david.abrahams_at_r...> wrote:
>
> ----- Original Message -----
> From: "bill_kempf" <williamkempf_at_h...>
>
> > What alternative design do you propose?
>
> How about the free functions proposed by Jeremy?

Again, the free function approach doesn't discourage usage
by "newbies". I've seen many MT libraries that expose lock/unlock on
the mutex class's public interface (which is equivalent to free
functions) as well as providing the Scoped Lock classes for "safer"
usage. Despite documentation warning of the issues most "newbies"
invariably call lock/unlock directly instead of using the Scoped
Lock, and the result is usually buggy programs that seem to run
during testing but deadlock when software is released. Maybe I'm
trying to hard, but I want to prevent this newbie mistake while not
preventing the experts from easily extending the library in ways that
scoped locking causes problems.

> BTW, I note that traits classes normally don't have functions
> (numeric_limits<>::min()/max() are nasty outliers), so that also
grates on
> me a bit as un-idiomatic?

std::char_traits<> has 14 static functions. Is it really un-
idiomatic?

Bill Kempf


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