Boost logo

Boost :

Subject: Re: [boost] Proposed new RAII Library
From: Sohail Somani (sohail_at_[hidden])
Date: 2012-09-14 10:56:46


On 14/09/2012 9:22 AM, Andrey Semashev wrote:
> On Friday 14 September 2012 09:07:07 Sohail Somani wrote:
>> On 14/09/2012 1:36 AM, Andrey Semashev wrote:
>>> Actually, there's this procedure:
>>>
>>> http://www.boost.org/development/submissions.html
>>>
>>> Specifically, a formal review is required before the library can be
>>> committed.
>>> Also, the library author should probably read this:
>> My view is that it's a missing feature in the existing Scope Exit library.
>
> I don't think so. I've been using Boost.ScopeExit for quite a while and don't
> really miss the scope guard function (like the proposed RAIIFunction). If it
> is proposed it has to provide something remarkably different or benefical,
> IMHO.
>
> As for the RAII wrapper, this component may well deserve its own mini-library.

A proposed library should be more than a tweak on an existing idea that
fits just fine with an existing library. BOOST_SCOPE_EXIT is way
overkill for simple handle closing or transaction commit operations:

   BOOST_SCOPE_EXIT( (&handle) )
   {
     CloseHandle(handle);
   }

vs

   boost::scope_exit OMGINEEDANAME(CloseHandle,handle);

I'd even be OK with:

   BOOST_SCOPE_EXIT(CloseHandle,handle);

Too many curly braces in my code already. I need more :: and BOOST_*

Sohail


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