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:
parent
c64503fb33
commit
b37dc0bc90
12 changed files with 89 additions and 119 deletions
|
|
@ -181,19 +181,19 @@ namespace spot
|
|||
static std::ostream& dump_instances(std::ostream& os);
|
||||
|
||||
protected:
|
||||
typedef std::pair<type, vec*> pair;
|
||||
typedef std::pair<type, vec*> key;
|
||||
/// Comparison functor used internally by ltl::multop.
|
||||
struct paircmp
|
||||
{
|
||||
bool
|
||||
operator()(const pair& p1, const pair& p2) const
|
||||
operator()(const key& p1, const key& p2) const
|
||||
{
|
||||
if (p1.first != p2.first)
|
||||
return p1.first < p2.first;
|
||||
return *p1.second < *p2.second;
|
||||
}
|
||||
};
|
||||
typedef std::map<pair, const multop*, paircmp> map;
|
||||
typedef std::map<key, const multop*, paircmp> map;
|
||||
static map instances;
|
||||
|
||||
multop(type op, vec* v);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue