Use emplace() for associative containers.

* HACKING: Adjust requirements.  g++4.8 is now OK
for all our targets.
* iface/dve2/dve2.cc, src/dstarparse/dstarparse.yy
src/dstarparse/nsa2tgba.cc, src/graph/ngraph.hh,
src/ltlast/atomic_prop.cc, src/ltlast/binop.cc, src/ltlast/bunop.cc,
src/ltlast/multop.cc, src/ltlast/unop.cc, src/ltlvisit/mark.cc,
src/ltlvisit/relabel.cc, src/taalgos/emptinessta.cc,
src/taalgos/tgba2ta.cc, src/tgba/tgbaexplicit.hh, src/tgba/tgbagraph.hh,
src/tgba/tgbasafracomplement.cc, src/tgba/tgbatba.cc,
src/tgbaalgos/cycles.cc, src/tgbaalgos/degen.cc,
src/tgbaalgos/dtbasat.cc, src/tgbaalgos/dtgbasat.cc,
src/tgbaalgos/emptiness.cc, src/tgbaalgos/gtec/gtec.cc,
src/tgbaalgos/ltl2tgba_fm.cc, src/tgbaalgos/magic.cc,
src/tgbaalgos/ndfs_result.hxx, src/tgbaalgos/reachiter.cc,
src/tgbaalgos/scc.cc, src/tgbaalgos/sccfilter.cc, src/tgbaalgos/se05.cc,
src/tgbaalgos/simulation.cc, src/tgbaalgos/tau03.cc,
src/tgbaalgos/tau03opt.cc, src/tgbaalgos/weight.cc: Use emplace()
instead of insert(make_pair(...)) or insert(...::value_type(...)).
This commit is contained in:
Alexandre Duret-Lutz 2014-07-31 16:59:47 +02:00
parent 1eaaf8832a
commit fd5fbda4dd
35 changed files with 77 additions and 104 deletions

View file

@ -431,7 +431,7 @@ namespace spot
last_dest = dest;
dmi = dm.find(dest);
if (dmi == dm.end())
dmi = dm.insert(std::make_pair(dest, acc_map())).first;
dmi = dm.emplace(dest, acc_map()).first;
}
int acc = t1->acceptance_conditions.id();
typename acc_map::iterator it = dmi->second.find(acc);
@ -460,8 +460,7 @@ namespace spot
if (j != alias_.end())
return j->second;
State* res =
&(ls_.insert(std::make_pair(name, State(name))).first->second);
State* res = &(ls_.emplace(name, State(name)).first->second);
sl_[res] = name;
// The first state we add is the initial state.
// It can also be overridden with set_init_state().

View file

@ -386,7 +386,7 @@ namespace spot
}
key_t k(t->dst, t->acc.id());
auto p = trmap.insert(make_pair(k, t.trans()));
auto p = trmap.emplace(k, t.trans());
if (!p.second)
{
// A previous transitions exist for k, merge the

View file

@ -1184,8 +1184,8 @@ namespace spot
p.second, false);
state_complement* s2 = new state_complement(e->clone(), e->clone(),
p.second, true);
succ_list.insert(std::make_pair(p.first, s1));
succ_list.insert(std::make_pair(p.first, s2));
succ_list.emplace(p.first, s1);
succ_list.emplace(p.first, s2);
}
}
else
@ -1210,7 +1210,7 @@ namespace spot
{
st = new state_complement(e->clone(), e->clone(),
p.second, true);
succ_list.insert(std::make_pair(p.first, st));
succ_list.emplace(p.first, st);
}
condition = the_acceptance_cond_;
}
@ -1219,7 +1219,7 @@ namespace spot
for (auto& p: tr->second)
{
st = new state_complement(newI, newJ, p.second, true);
succ_list.insert(std::make_pair(p.first, st));
succ_list.emplace(p.first, st);
}
}
delete newI;
@ -1234,7 +1234,7 @@ namespace spot
{
st = new state_complement(pending->clone(), e->clone(),
p.second, true);
succ_list.insert(std::make_pair(p.first, st));
succ_list.emplace(p.first, st);
}
delete pending;

View file

@ -315,8 +315,8 @@ namespace spot
transmap_t::iterator id = transmap_.find(key);
if (id == transmap_.end()) // No
{
mapit_t pos = transmap_
.insert(std::make_pair(key, it->current_condition())).first;
mapit_t pos =
transmap_.emplace(key, it->current_condition()).first;
// Keep the order of the transitions in the
// degeneralized automaton related to the order of the
// transitions in the input automaton: in the past we