>I think a regular function taking the class object as an argument >is simplest. But not necessary, as the class of the object can be determined with a single call at runtime. C//