list结构体根据某个成员进行排序

#include
#include 
using namespace std;

struct camerafoucs
{
	int index;
	int value;
	bool operator<(camerafoucs b)
	{
		return value foucslist;
	for(int i=0; i<10; i++)
	{
		foucslist.push_back(foucsvalue[i]);
	}

    foucslist.sort(); 

	list::iterator i;
	
	for (i=foucslist.begin(); i!=foucslist.end(); ++i)
	{
		cout<(*i).value<<" ";
	}
	cout<

你可能感兴趣的:(C++)