From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2008-08-07 09:44:09
-----BEGIN PGP SIGNED MESSAGE-----
On Thursday 07 August 2008 09:36 am, Frank Mori Hess wrote:
> Couldn't you use lambda for this?
> boost::shared_ptr<int> s;
> 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.
Err, nevermind. This will fail when sockfd goes out of scope.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
-----END PGP SIGNATURE-----