gpt4 book ai didi

c++ - 如何更新一组 std::pair 中的成员?

转载 作者:搜寻专家 更新时间:2023-10-31 00:09:32 25 4
gpt4 key购买 nike

<分区>

我试过这样做:

std::set< pair<int, int> > mySet;

// fill the set with something

mySet.find( make_pair(someValueX, someValueY) )->first = newX;

但编译时出现以下错误:

error: assignment of member 'std::pair<int, int>::first' in read-only object|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===||

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com