What is the difference between using a struct with two fields and a pair?

后端 未结 6 599
刺人心
刺人心 2020-12-03 06:42

What is the difference regarding memory allocation and efficiency between using a struct with two fields and a pair?

6条回答
  •  误落风尘
    2020-12-03 07:06

    As stated in std::pair vs struct with two int's a struct will probably be a little bit faster because no initialization is made.

提交回复
热议问题