From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2008-08-07 09:36:51
-----BEGIN PGP SIGNED MESSAGE-----
On Wednesday 06 August 2008 18:25 pm, Emil Dotchevski wrote:
> Does anyone besides me find this code useful:
> It could go in boost/handle.hpp and could be used to manage any type
> of handle in a shared_ptr, for example one could do:
> shared_ptr<int> s;
> int sockfd = socket(PF_INET,SOCK_STREAM,0);
> if( sockfd!=-1 )
Couldn't you use lambda for this?
int sockfd = socket(PF_INET,SOCK_STREAM,0);
if( sockfd!=-1 )
s.reset(&sockfd, boost::lambda::bind(close, * boost::lambda::_1));
I've never really used lambda, but it compiles at least. By the way, is there
any documentation on the lambda headers (which ones to include to use what)?
I didn't see anything in the lambda docs.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
-----END PGP SIGNATURE-----
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk