
14 Sep
2012
14 Sep
'12
6:58 p.m.
Sohail Somani <sohail <at> taggedtype.net> writes:
Oh, it's limited because you can't include any state in the deallocation:
void youLikeThis(bool doYou,Handle h);
boost::scope_guard OMGANAME(youLikeThis,true,handle);
Not possible if everything is encoded in the type.
True, but that is why I was proposing two RAII classes. One that is limited and uses only static values for the deleter function and the no-delete value, and another that is much more open including state (RAIIFunction) because you can use bind with it, and lambda's that provide any needed state. -Andrew Sandoval