
29 May
2010
29 May
'10
1:13 p.m.
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