【发布时间】:2020-08-03 13:35:24
【问题描述】:
我不确定带有boost::bind 的以下代码 sn-p 在这里做什么:
//..
Instrument::Exchanges e;
// typedef for std::vector<Instrument::Exchange>
std::transform(exchangeMap_.begin(), exchangeMap_.end(),
std::back_inserter(e),
boost::bind(&ExchangeMap::value_type::second, _1));
//..
ExchangeMap 是 std::map<int, Instrument::Exchange> 的类型定义。
我阅读了以下documentation,但没能找到。我假设 &ExchangeMap::value_type::second 扩展为 ExchangeMap::pair<const int, Instrument::Exchange>::second 因此指向 Instrument::Exchange?
【问题讨论】: