STL gurus - suggestion needed. 
Author Message
 STL gurus - suggestion needed.

I am using a multi-child tree like data structure where more than one
node nodes can have identical data. for example:

                root
                  |
        -----------------------
        |                       |
        cat                     bat
        |                       |
-----------------       -------------------------
|       |       |       |       |       |       |
bat   bat      mat      apple  pear    pear    apple

The problem is, when I am using "find" to find a specific node, it is
returning the first occurance of that node.
it's of the form:

<iterator> = find (tree.begin(), tree.end(), value)
what i want to do is insert another true/false condition check in
addition to "value".

Is there any standard way to do it ?

Thanks for all your help in advance.



Sat, 25 Dec 2004 04:13:20 GMT  
 STL gurus - suggestion needed.
find_if accepts a predicate. You can write a predicate that checks for
value as well as your additional condition.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> I am using a multi-child tree like data structure where more than one
> node nodes can have identical data. for example:

> root
>   |
> -----------------------
> | |
> cat bat
> | |
> ----------------- -------------------------
> |       | | | | | |
> bat   bat      mat      apple  pear    pear    apple

> The problem is, when I am using "find" to find a specific node, it is
> returning the first occurance of that node.
> it's of the form:

> <iterator> = find (tree.begin(), tree.end(), value)
> what i want to do is insert another true/false condition check in
> addition to "value".

> Is there any standard way to do it ?

> Thanks for all your help in advance.



Sat, 25 Dec 2004 04:24:37 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. STL Guru needed (map iterater giving exceptions)

2. Any Microsoft/STL book suggestions?

3. need suggestion: writing a "todo" list ; need structure suggestion

4. ATL7 oledb consumer guru needed urgently

5. c++ msxml guru needed

6. Crypto Gurus need help!!

7. Gurus need ur help!!

8. Accessing Exif Metadata: need some guru help

9. need sprintf() guru advice

10. ???? Attn C Gurus I Need Help ?????

11. PLEASE HELP-I NEED LINKED LIST GURUS!

12. Need some regex advice from the gurus!

 

 
Powered by phpBB® Forum Software