Home » U++ Library support » U++ Core » Small fix for Find in Algo.h
Small fix for Find in Algo.h [message #20327] |
Wed, 11 March 2009 18:38 |
gridem
Messages: 45 Registered: August 2008
|
Member |
|
|
I think that this patch solves the problem for Find function (it should compare the values):
template <class T, class V>
T Find(T ptr, T end, const V& value)
{
- return Find(ptr, end, value, StdEqual<T>());
+ return Find(ptr, end, value, StdEqual<V>());
}
|
|
|
|
|
|
|
Re: BUG for Find in Algo.h [message #34943 is a reply to message #34776] |
Mon, 19 December 2011 10:10 |
gridem
Messages: 45 Registered: August 2008
|
Member |
|
|
There are 2 issues:
1. You should check iterator for NULL. This is difference between STL and U++.
2. You should use reference instead of value:
The correct code is:
if (it != NULL)
{
CAppli& apptmp = *it; // use reference
apptmp.update();
|
|
|
Goto Forum:
Current Time: Mon Apr 29 08:35:37 CEST 2024
Total time taken to generate the page: 0.02392 seconds
|