#include #include #include "gas.h" #include "liquid.h" #include "solid.h" using namespace std; int main() { solid ice = 10; liquid water = 20; gas steam = 30; water = ice; //convert solid to liquid: water = ice.operator liquid(); steam = water; //convert liquid to gas: steam = water.operator gas(); //steam = ice; //won't compile //steam = static_cast(ice); //won't compile steam = static_cast(ice); //ice.operator liquid().operator gas(); return EXIT_SUCCESS; }