Subject: Re: [boost] [system][filesystem v3] Question about error_code arguments
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2009-10-20 11:52:18
-----BEGIN PGP SIGNED MESSAGE-----
On Tuesday 20 October 2009, Peter Dimov wrote:
> Beman Dawes wrote:
> > A POSIX sub-group is looking at C++ bindings for POSIX.
> > They are talking about a filesystem library binding at least loosely
> > based on Boost.System, Boost.Filesystem, and C++ TR2.
> > In looking at
> > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2838.html,
> > "Library Support for Hybrid Error Handling (Rev 2)", they are
> > concerned about specifying hybrid error handling like this:
> > void f(error_code& ec=throws());
> > They would rather see it specified like this:
> > void f(error_code* ec=0);
> > Regardless, I'd like to hear Boosters views on the two interfaces
> > above. Which do you prefer? Why?
> I prefer the pointer form, because it's idiomatic. The reference form is an
I agree. I've never heard of a null reference in C++ before reading the
original post. I thought one of the selling points of references was they
can't be null.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
-----END PGP SIGNATURE-----
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk