customising stl find algorithm

customising stl find algorithm

class tTaskType
{

public:
int data;
bool operator == (int k)
{
if(k ==data)
return true;
else
return false;
}
};

---------------------------------
Main()
tTaskType s1,s2,s3;

s1.data =10;
s2.data =12;
s3.data =13;

list test;
list::iterator Itrtest;

test.push_back(s1);
test.push_back(s2);
test.push_back(s3);


Itrtest =std::find(test.begin(),test.end() ,10) ;

if(Itrtest!=test.end() )
{
printf("Found\n");
}

Comments

Popular posts from this blog

Long running Java process resource consumption monitoring , leak detection and GC tuning

OpenLayers Advanced Clustering and Setting dynamic images for OpenLayer Styles via Ajax

Compiling OpenCV with CUDA (GPU) using CMake (GUI)