@@ -41,8 +41,8 @@ class doesnt_match_exception {};
4141class eof_found_exception {};
4242class generate_exception {};
4343
44- const int display_before_error = 65 ;
45- const int display_after_error = 50 ;
44+ constexpr int display_before_error = 65 ;
45+ constexpr int display_after_error = 50 ;
4646
4747size_t prognr;
4848const command *currcmd;
@@ -63,8 +63,8 @@ vector<command> program;
6363// This stores array-type variables like x[i,j] as string "x" and
6464// vector of the indices. Plain variables are stored using an index
6565// vector of zero length.
66- typedef map<vector<bigint>,value_t > indexmap ;
67- typedef map<value_t ,set<vector<bigint>>> valuemap ;
66+ using indexmap = map<vector<bigint>,value_t >;
67+ using valuemap = map<value_t ,set<vector<bigint>>>;
6868map<string,indexmap> variable, preset;
6969map<string,valuemap> rev_variable, rev_preset;
7070
@@ -322,11 +322,11 @@ value_t value(const expr& x)
322322
323323template <class A , class B >
324324struct arith_result {
325- typedef typename conditional<
325+ using type = typename conditional<
326326 is_same<A,bigint>::value && is_same<B,bigint>::value,
327327 bigint,
328328 mpf_class
329- >::type type ;
329+ >::type;
330330};
331331
332332template <class A , class B > struct arith_compatible {
@@ -352,7 +352,7 @@ struct arithmetic_##name : public boost::static_visitor<value_t> {\
352352 }\
353353 template <class A , class B , typename enable_if<arith_compatible<A,B>::value,int >::type = 0 ,\
354354 class C = typename arith_result<A,B>::type>\
355- value_t operator ()(const A& a, const B& b)const {\
355+ value_t operator ()(const A& a, const B& b)const {\
356356 return value_t (C (a op b));\
357357 }\
358358};\
@@ -364,12 +364,12 @@ value_t operator op(const value_t &x, const value_t &y) \
364364#define DECL_VALUE_CMPOP (op,name ) \
365365struct arithmetic_ ##name : public boost::static_visitor<bool > {\
366366 template <class A , class B , typename enable_if<!is_comparable<A,B>::value,int >::type = 0 >\
367- bool operator ()(const A& a, const B& b)const {\
367+ bool operator ()(const A& a, const B& b)const {\
368368 cerr << " cannot compute " << a << " " #op " " << b << endl; \
369369 exit (exit_failure);\
370370 }\
371371 template <class A , class B , typename enable_if<is_comparable<A,B>::value,int >::type = 0 >\
372- bool operator ()(const A& a, const B& b)const {\
372+ bool operator ()(const A& a, const B& b)const {\
373373 return a op b;\
374374 }\
375375};\
0 commit comments