Is boost tuple mutable?

1.2k views Asked by At

I have been using a using a boost tuple as the value in an STL map. Up until now, I only had to construct the tuple and insert into the map and at a later stage retrieve the values.

Now I need to be able to change the tuple in the map. Is this possible, or have I run into the one place you should'nt be using tuples instead of structs.

thanks

1

There are 1 answers

1
Sebastian On BEST ANSWER

As long as the tuple is the map value and not the key, the tuple is perfectly mutable:

http://www.boost.org/doc/libs/1_41_0/libs/tuple/doc/tuple_users_guide.html#accessing_elements