#ifndef YINGYANGH #define YINGYANGH #include using namespace std; class yang; //forward declaration class ying { yang *p; yang& r; vector v; public: ying(yang& initial_y): p(&initial_y), r(initial_y) {} //yang f(yang y) const {return y;} //won't compile yang f(yang y) const; yang *g(yang *y) const {return y;} }; class yang { ying *p; ying& r; vector v; public: yang(ying& initial_y): p(&initial_y), r(initial_y) {} ying f(ying y) const {return y;} ying *g(ying *y) const {return y;} }; inline yang ying::f(yang y) const //Must be written after lines 21-30. { return y; } #endif