Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Algorithms and Vectors
Re: Algorithms and Vectors [message #28142 is a reply to message #28138] Wed, 18 August 2010 17:20 Go to previous messageGo to previous message
281264 is currently offline  281264
Messages: 272
Registered: June 2010
Location: Spain
Experienced Member
Hi Honza,

Roger ! however I have noticed the following:

1.- even with < in the class the code does not compile, why?
2.- if I replace the class by the function:
bool operator<(const A& lhs, const A& rhs){
		return lhs.a<rhs.a;	
}

then, it does compile but it does not behave as expected (it returns -1).So it does not work.

My query is how to “find” that an element within Vector<A> that complies with a criterion, for instance a==5;

Note: I have tested Sort algorithm and works fine.

Any suggestions?

Thanks,

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: Sat Jun 21 20:08:53 CEST 2025

Total time taken to generate the page: 0.03904 seconds