Boost logo

Boost :

From: Stewart, Robert (stewart_at_[hidden])
Date: 2002-03-01 08:31:19

From: Beman Dawes [mailto:bdawes_at_[hidden]]
> At 10:05 AM 2/28/2002, Aleksey Gurtovoy wrote:
> >Stewart, Robert wrote:
> >> There are two approaches to such functions: return bool or a
> >> status code and wrap to get exceptions, or throw exceptions
> >> and wrap to get a bool or status code.
> >
> >The library can also take the burden of wrapping away from user and
> provide
> >both versions:
> >
> > void remove(std::string const& path); // throws
> > bool remove(std::string const& path, std::nothrow_t
> const&) throw();
> >
> >Just an idea.

I hadn't thought of std::nothrow_t, but that is the sort of thing I had in

> The same idea occurred to me. Needs a bit more thought, but
> might be a
> reasonable way to encourage good programming practices
> without requiring
> them where they don't apply. I like the idea of making the
> less safe code
> a bit uglier:-)

You'll get no argument from me; the ugliness highlights the lower safety.

Susquehanna International Group, LLP

Boost list run by bdawes at, gregod at, cpdaniel at, john at