2 Dec
2023
2 Dec
'23
2:30 p.m.
Andrey Semashev wrote:
If typing [&] is a problem, you could just
#define SCOPE_GUARD BOOST_SCOPE_FINAL [&]
and use that. Personally, I have no problem with the capture list, and quite often I actually use capture lists more elaborate than [&].
I _think_ that it might be possible to make the capture list optional by using BOOST_SCOPE_FINAL { }; and BOOST_SCOPE_FINAL(&) { }; but I'm not 100% sure. (And maybe rename it to BOOST_SCOPE_DEFER.)