Boost logo

Boost :

From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2007-04-06 16:16:24

Andrey Semashev wrote:
> For me the performance is of high concern. I expect the
> BOOST_SCOPE_EXIT performance to be comparable to a hand-written scope
> guard like that:
> struct guard
> {
> ~guard()
> {
> // guard body
> }
> };

My last solution wraps scope-exit-block into a function, take an
address of this function and calls it indirectly. I don't know (yet)
if any compiler is able to optimize this call away, though.

> Another thing I expect is the guard's construction error safety. I.e.
> it may not involve things like dynamic memory allocations, TLS slot
> acquirement, etc., and should minimize copying of any user's objects.
It's very lightweight.

Alexander Nasonov
When you are arguing against Him you are arguing against the very
power that makes you able to argue at all. -- C.S. Lewis --
This quote is generated by: 
	/usr/pkg/bin/curl -L         \
	  | sed -e 's/^document\.write(.//' -e 's/.);$/ --/'  \
	        -e 's/<[^>]*>//g' -e 's/^More quotes from //' \
	  | fmt | tee ~/.signature-quote

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