by "Gernot Frisch" <Me@[EMAIL PROTECTED]
>
Sep 11, 2007 at 01:31 PM
> Actually, if you look at the C++ class I was defining I was actually
> doing
> that. The parts class didn't predefine anything. That would be up
> to whatever called it.
Nathan's solution is best. If you want an "arm" pointer, you might
have each body assigned with a unique description string, and make an
operator:
body* operator[] (const std::string& bodyname)
{
if(this->m_name == bodyname) return this;
for(std::container<body>::iterator it=m_bodies.begin();
it!=m_bodies.end(); ++it)
return it->operator[](bodyname);
return NULL;
}