Boost logo

Boost :

Subject: Re: [boost] [multiindex] internal scope_guard has changed access from public to protected
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2010-05-29 09:13:26


Joaquin M Lopez Munoz skrev:
> Thorsten Ottosen <nesotto <at> cs.aau.dk> writes:

>>
>> Would it not be possible to add a bool template parameter to
>> make_obj_guard() such we can simply write
>>
>> scope_guard g = make_obj_guard<some_condition<T>::value>(...);
>
> Yep, this seems like a general enough functionality to be
> included in scope_guard.hpp. I'd prefer to leave make_obj_guard
> like it is and add an additional
>
> make_obj_guard_if<...>
>
> (note the _if) for your use case, which creates a null_guard
> if the condition is not true.
>
> Would you like to do the addition yourself and commit the
> changes to the trunk? I'm quite busy these days to do it
> myself.

Yes, no problem.

I'll post the code here before comitting.

-Thorsten


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