Brainache
Member
|
Memb find
if I have a Memb defined as:
Memb<Particles> particles
can i get the index to a member of the Memb by passing in a Particles object?
the memb header shows this...
Int index (TYPE *elm){return _Memb::index (elm);
which would lead me to expect:
Particles p;
int i = particles.find(&p);
to work.. but that is causing errors...
Thanks!
|
|
12-17-2009 12:31 AM |
|
Esenthel
Administrator
|
RE: Memb find
Memb::find compares the values (like Particle==Particle)
you should use Memb::index
|
|
12-17-2009 05:25 AM |
|
Brainache
Member
|
RE: Memb find
but I pass a pointer to the element?
|
|
12-17-2009 02:17 PM |
|
Esenthel
Administrator
|
RE: Memb find
yes, Memb::index requires the elements address, and then it checks if the container has an element of that address
|
|
12-17-2009 04:12 PM |
|