如何从对象数组中检索字段数组?

时间:2012-05-09 21:44:52

标签: c++

  

可能重复:
  Sorting a vector of objects by a property of the object

我的结构如下:

strcut Point
{
   int x;
   int y;
   int z;
};

我还有一个整数的通用排序函数:

void sort(vector<int>);              

在我的程序中,我需要使用不同的字段(即x,y或z)对std :: vector频繁排序。如何有效地将Point数组转换为整数数组?

0 个答案:

没有答案
相关问题