Is there a standard C++ function object for taking apart a std::pair?

前端 未结 6 1606
粉色の甜心
粉色の甜心 2020-12-20 14:06

Does anyone know if there\'s a de-facto standard (i.e., TR1 or Boost) C++ function object for accessing the elements of a std::pair? Twice in the past 24 hours I\'ve wished

6条回答
  •  甜味超标
    2020-12-20 14:33

    From the way you worded your question, I'm not sure this is a proper response, but try boost::tie (part of the Boost::tuple library). It works on std::pairs too.

提交回复
热议问题