fixed splice bug on Sun CC

This commit is contained in:
Mariette Yvinec 2002-05-02 17:16:27 +00:00
parent 56012ed16c
commit a1e87a1fe9
2 changed files with 12 additions and 6 deletions

View File

@ -549,15 +549,21 @@ add_Steiner(T va, T vb, T vc){
H_context_list* hcl3;
if (get_contexts(va,vc,hcl3)) { // (va,vc) is already a subconstraint
//hcl3->splice(hcl3->end(), *hcl);
hcl3->splice(hcl3->begin(), *hcl);
#ifdef __SUNPRO_CC
std::copy(hcl->begin(), hcl->end(), std::back_inserter(*hcl3));
#else
hcl3->splice(hcl3->end(), *hcl);
#endif
delete hcl;
}
else sc_to_c_map.insert(std::make_pair(make_edge(va,vc), hcl));
if (get_contexts(vc,vb,hcl3)) {// (vc,vb) is already a subconstraint
//hcl3->splice(hcl3->end(),*hcl2);
hcl3->splice(hcl3->begin(), *hcl2);
#ifdef __SUNPRO_CC
std::copy(hcl2->begin(), hcl2->end(), std::back_inserter(*hcl3));
#else
hcl3->splice(hcl3->end(),*hcl2);
#endif
delete hcl2;
}
else sc_to_c_map.insert(std::make_pair(make_edge(vc,vb), hcl2));

View File

@ -91,12 +91,12 @@ _test_cls_hierarchy_2()
vit = co_it->vertices_begin();
assert ( *vit++ == v[1] &&
*vit++ == v[5] &&
*vit++ == v[8]);
*vit++ == v[2]);
co_it++;
vit = co_it->vertices_begin();
assert ( *vit++ == v[1] &&
*vit++ == v[5] &&
*vit++ == v[2]);
*vit++ == v[8]);
co_it++;
assert (co_it == h.contexts_end(v[1],v[5]));