What is std::pair?

前端 未结 10 1723
面向向阳花
面向向阳花 2020-12-12 19:07

What is std::pair for, why would I use it, and what benefits does boost::compressed_pair bring?

10条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-12 20:06

    It's standard class for storing a pair of values. It's returned/used by some standard functions, like std::map::insert.

    boost::compressed_pair claims to be more efficient: see here

提交回复
热议问题