Boost logo

Boost :

From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2007-08-20 05:34:17

Goran Mitrovic <gmit <at>> writes:

> ScopeExit seems like a very nice utility, but, I don't think I could ever
> use it because of two things:
> 1. Dependence on boost.typeof. I would like the native typeof keyword,
> but, boost.typeof too much stresses compile type and a requirement of type
> registration is so unergonomic that makes boost.typeof a very nice and
> powerful demo, but not a useful utility for every day use.

AFAIK, native mode is default if compiler supports typeof/decltype. So you can
skip type registration if your compiler supports typeof natively.

> 2. Unusual syntax, both for me and someone who would later work on my
> code. Using preprocessor sequence and having BOOST_SCOPE_EXIT_END after {}
> braces looks so unnatural in C++.

Have you tried boost.lambda? I bet you will feel comfortable with ScopeExit
syntax after writing 10 ScopeExit bodies but mastering lambda skills would take
a month.
I spent 5 minutes writing and debugging lambda for Alternatives.ScopeGuard
section but it took me only 10 seconds to type ScopeExit.


Boost list run by bdawes at, gregod at, cpdaniel at, john at