ltlast: simplify with std::make_pair() and c++11's std::tuple

* src/ltlast/atomic_prop.cc, src/ltlast/atomic_prop.hh,
src/ltlast/automatop.cc, src/ltlast/automatop.hh, src/ltlast/binop.cc,
src/ltlast/binop.hh, src/ltlast/bunop.cc, src/ltlast/bunop.hh,
src/ltlast/multop.cc, src/ltlast/multop.hh, src/ltlast/unop.cc,
src/ltlast/unop.hh: Use std::tuple to replace nested std::pair,
simplify calls to std::map::erase, use auto and std::make_pair with
insert, and simplify the dump() method using a range for.
This commit is contained in:
Alexandre Duret-Lutz 2014-01-06 20:04:53 +01:00
parent c64503fb33
commit b37dc0bc90
12 changed files with 89 additions and 119 deletions

View file

@ -25,6 +25,7 @@
#include "refformula.hh"
#include <map>
#include <iosfwd>
#include <tuple>
#include "constant.hh"
namespace spot
@ -140,10 +141,8 @@ namespace spot
}
protected:
typedef std::pair<unsigned, unsigned> pairu;
typedef std::pair<type, const formula*> pairo;
typedef std::pair<pairo, pairu> pair;
typedef std::map<pair, const bunop*> map;
typedef std::tuple<type, const formula*, unsigned, unsigned> key;
typedef std::map<key, const bunop*> map;
static map instances;
bunop(type op, const formula* child, unsigned min, unsigned max);