我有以下代码:
std::map<
const CosTransactions::otid_t,
std::pair<
CosTransactions::otid_t,
CosTransactions::Coordinator_ptr>,
otid_t_less> XID_Broker_impl::cache;
编译上述代码时,出现如下错误:
D:/Y24\usr\include/xmemory", line 144: error(483): function
"std::allocator<_Ty>::address(std::_Allocator_base<_Ty>::value_type
&) const [with _Ty=const CosTransactions::otid_t]" has already been
declared
detected during:
instantiation of class
我正在使用 HP-Nonstop C++ 编译器?当我删除 map 中键的“const”时,错误消失了。这是否意味着我不能在地图中使用“const key”?请帮我解决这个问题