Are nested structured bindings possible?

前端 未结 2 1395
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-07 16:21

Assume I have an object of type

std::map> data;

Is it possible to access the element types

2条回答
  •  无人及你
    2021-01-07 16:30

    No, they aren't possible; but this is:

    for (auto&& [key, value] : data) {
      auto&& [my_int, my_float] = value;
    }
    

    which is close at least.

提交回复
热议问题