c++ 的 static_cast
http://www.cnblogs.com/pigerhan/archive/2013/02/26/2933590.html
#include "Person.h" #include <string> #include <iostream> Person::Person() { } void Person::sayHello() { std::cout << "hello world"; } int main(void) { Humankind humanKind = Humankind(); humanKind.sayHello(); Person person = static_cast<Person>(humanKind); humanKind.sayHello(); person.sayHello(); std::cin.get(); }