U++ framework
Do not panic. Ask here before giving up.

Home » Community » Newbie corner » Algorithms and Vectors
Re: Algorithms and Vectors [message #28136 is a reply to message #28132] Wed, 18 August 2010 12:30 Go to previous messageGo to previous message
281264 is currently offline  281264
Messages: 272
Registered: June 2010
Location: Spain
Experienced Member
Thanks. This is an easy example, but it does not work

struct A:Moveable<A>{
	
	int a;
	A(int x){a=x;}
};

class Predicate
{
	
public:	
	
	bool operator()(const A& lhs, const A& rhs){
		return lhs.a==rhs.a;	
	}
	
};


int main(){
	
	A vector_b(1);
	Vector<A> vector_a;
	
	vector_a.Add(1);
	vector_a.Add(2);
	
	FindBinary(vector_a,vector_b,Predicate());	
	
	return 0;	
}


why?

Cheers,

Javier
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Open An image upon startup
Next Topic: Assert failed in core/value.h line 464
Goto Forum:
  


Current Time: Sun May 10 03:55:46 GMT+2 2026

Total time taken to generate the page: 0.00429 seconds