#ifndef MONEY_H #define MONEY_H enum Currency { CAD, DM, USD, Yen }; class Curve { public: Curve( Currency ) {} double convert( Currency, Currency, double amt ) const { return amt; } }; template class Money { public: Money( double amt ); template Money( const Money & ); template Money &operator =( const Money & ); ~Money(); double get_amount() const { return amt_; } //... private: Curve *myCurve_; double amt_; }; template Money::Money( double amt ) : myCurve_( new Curve(currency) ), amt_(amt) {} template Money::~Money() { delete myCurve_; } template template Money::Money( const Money &that ) : myCurve_( new Curve(currency) ), amt_(myCurve_->convert(currency,otherCurrency,that.get_amount())) {} template template Money &Money::operator =( const Money &rhs ) { amt_ = myCurve_->convert( currency, otherCurrency, rhs.get_amount() ); return *this; } #endif