medfall

A super great game engine
Log | Files | Refs

commit ab76b763c7874ba8a54b9414ace02dd66d296540
parent 5fa078bf0b01af35c117546dd9139ec372d1cb16
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Fri Aug  4 09:28:17 -0700

SCOPE_EXIT captures by reference

Diffstat:
intrinsics.h | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/intrinsics.h b/intrinsics.h @@ -155,7 +155,7 @@ template< typename F > inline ScopeExit< F > MakeScopeExit( F f ) { return ScopeExit< F >( f ); }; -#define SCOPE_EXIT( code ) auto COUNTER_NAME( SCOPE_EXIT_ ) = MakeScopeExit( [=]() { code; } ) +#define SCOPE_EXIT( code ) auto COUNTER_NAME( SCOPE_EXIT_ ) = MakeScopeExit( [&]() { code; } ) template< typename S, typename T > struct SameType {