Update of /cvsroot/openvrml/openvrml/src/libopenvrml
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16735/src/libopenvrml
Modified Files:
private.h
Log Message:
ScopeGuard as initially described by Alexandrescu and Marginean copies the callback function parameters to the guard implementation. This means that the callback is called with the values given when make_guard gets called--not whatever the values might be when execution in the scope completes.
>
> This changes OpenVRML's implementation of ScopeGuard to keep const references to the parameters in the guard implementation. Also, use of boost::multi_index::detail::scope_guard (where use of OpenVRML's ScopeGuard implementation is inconvenient) now explicitly gives a reference template parameter to the instantiation of make_guard to circumvent this problem.
Index: private.h
===================================================================
RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/private.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** private.h 23 Oct 2006 06:39:28 -0000 1.12
--- private.h 2 Jan 2007 00:08:33 -0000 1.13
***************
*** 191,195 ****
class OPENVRML_LOCAL scope_guard_impl1 : public scope_guard_impl_base {
Function function;
! const Param param;
public:
--- 191,195 ----
class OPENVRML_LOCAL scope_guard_impl1 : public scope_guard_impl_base {
Function function;
! const Param & param;
public:
***************
*** 224,230 ****
class OPENVRML_LOCAL scope_guard_impl3 : public scope_guard_impl_base {
Function function;
! const Param1 param1;
! const Param2 param2;
! const Param3 param3;
public:
--- 224,230 ----
class OPENVRML_LOCAL scope_guard_impl3 : public scope_guard_impl_base {
Function function;
! const Param1 & param1;
! const Param2 & param2;
! const Param3 & param3;
public:
***************
*** 315,319 ****
Object & obj;
MemberFunction mem_fun;
! const Param param;
public:
--- 315,319 ----
Object & obj;
MemberFunction mem_fun;
! const Param & param;
public:
|