[boost-users][multi-index] passing modifier by reference/pointer?

Hello, Is there a simple way to pass a modifier by reference/pointer in the following expression: my_multi_index_container.modify(somePos, modifier); "modifier" is a functor that has some internal state, so I wouldn't like it to be copied. Is it possible to do this without an explicit creation of a binder that binds operator() and &modifier (or so)? Thanks.

Igor R <boost.lists <at> gmail.com> writes:
Hello,
Is there a simple way to pass a modifier by reference/pointer in the following expression:
my_multi_index_container.modify(somePos, modifier);
"modifier" is a functor that has some internal state, so I wouldn't like it to be copied. Is it possible to do this without an explicit creation of a binder that binds operator() and &modifier (or so)?
The following should do: modifier_type modifier(...); ... my_multi_index_container.modify<modifier_type&>(somePos, modifier); HTH, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo
participants (2)
-
Igor R
-
Joaquin M Lopez Munoz