Is there a convenient way to wrap std::pair as a new type?

后端 未结 8 1086
梦谈多话
梦谈多话 2021-02-02 17:02

Often times I find myself using std::pair to define logical groupings of two related quantities as function arguments/return values. Some examples: row/col, tag/value, etc.

8条回答
  •  臣服心动
    2021-02-02 17:42

    This is what Boost.Tuple was made for.

    But you should probably be using std::tuple now...

提交回复
热议问题