1

我一直在使用提升元组作为 STL 映射中的值。到目前为止,我只需要构造元组并插入到地图中,然后在稍后阶段检索值。

现在我需要能够更改地图中的元组。这是可能的,还是我遇到了一个你不应该使用元组而不是结构的地方。

谢谢

4

1 回答 1

3

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

于 2009-12-22T17:00:34.773 回答