#ifndef H_ValType #define H_ValType #include #include using namespace std; class ValType { public: ValType(const string & s) : str(s) { used = false; } ~ValType() { if (!used) cerr << "error: ambiguous return type" << endl; } // conversion operators operator double(); operator double*(); operator vector(); operator vector(); operator int(); operator string(); private: bool used; string str; int get_int(string str); double get_double(string str); double *get_double_array(string str); vector get_vector(string str); vector get_ivector(string str); string get_string(string str); }; #endif