Original Post
im using C++ and ive got something like this.. class A{}; class B1 : public A{}; class B2 : public A{}; std::vector as; for (int n = 0; n as.size(); ++n) { /* pseudo if ( as[n] is instance of B1) do something if ( as[n] is instance of B2) do something else do something */ } how would i do this? i could test with a dynamic_cast each time.. but that seems a bit slow?