id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 801,guard_impl objects should store references,braden,joaquintides,"{{{ In multi_index::detail::scope_guard, it seems to me that the guard_impl objects should store references to their parameters rather than copies. Consider the following code: T * obj = 0; scope_guard guard = make_guard(delete_T, obj); obj = create_T(); if (obj) { // do stuff } else { guard.dismiss(); } Since make_guard passes obj by copy (and the guard_impl holds a copy), the value passed to delete_T is always 0. This behavior can be defeated by explicitly giving make_guard a reference parameter: make_guard(delete_T, obj) However, that obviously gets quite verbose; and I don't see a downside to storing the parameters as references consistently. }}}",Bugs,closed,,multi_index,None,,None,,