From: Braden M. <br...@us...> - 2007-01-02 00:07:31
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16287/src/libopenvrml Modified Files: Tag: OpenVRML-0_16-BRANCH 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.11.2.1 retrieving revision 1.11.2.2 diff -C2 -d -r1.11.2.1 -r1.11.2.2 *** private.h 23 Oct 2006 06:39:17 -0000 1.11.2.1 --- private.h 2 Jan 2007 00:07:29 -0000 1.11.2.2 *************** *** 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: |