@@ -35,51 +35,10 @@ using namespace std;
3535
3636namespace checktestdata {
3737
38- struct none_t {};
39- ostream& operator <<(ostream& os, const none_t &) {
40- return os << " <no value>" ;
41- }
42-
43- struct value_t {
44- boost::variant<none_t , mpz_class, mpf_class, string> val;
45-
46- value_t (): val(none_t ()) {}
47- explicit value_t (mpz_class x): val(x) {}
48- explicit value_t (mpf_class x): val(x) {}
49- explicit value_t (string x): val(x) {}
50-
51- operator mpz_class () const ;
52- operator mpf_class () const ;
53-
54- // This is a member function instead of a casting operator, since
55- // otherwise the string could be used in other implicit casts.
56- string getstr () const ;
57-
58- // This converts any value type to a string representation.
59- string tostr () const ;
60- };
61-
62- const int value_none = 0 ;
63- const int value_int = 1 ;
64- const int value_float = 2 ;
65- const int value_string = 3 ;
66-
6738class doesnt_match_exception {};
6839class eof_found_exception {};
6940class generate_exception {};
7041
71- ostream& operator <<(ostream &os, const value_t &val)
72- {
73- return os << val.val ;
74- }
75-
76- string value_t::tostr () const
77- {
78- stringstream ss;
79- ss << *this ;
80- return ss.str ();
81- }
82-
8342const int display_before_error = 65 ;
8443const int display_after_error = 50 ;
8544
@@ -232,24 +191,6 @@ long string2int(string s)
232191 return res;
233192}
234193
235- value_t ::operator mpz_class () const
236- {
237- return boost::get<mpz_class>(val);
238- }
239-
240- value_t ::operator mpf_class () const
241- {
242- if (const mpz_class* p = boost::get<mpz_class>(&val))
243- return *p;
244- return boost::get<mpf_class>(val);
245- }
246-
247- string value_t::getstr () const
248- {
249- if ( val.which ()!=value_string ) error (" value is not a string" );
250- return boost::get<string>(val);
251- }
252-
253194value_t eval (const expr&); // forward declaration
254195
255196value_t getvar (const expr& var, int use_preset = 0 )
0 commit comments