charmxi: Don't use std::bind2nd with a reference argument, because older g++ (4.1...
authorPhil Miller <phil@login2.surveyor.alcf.anl.gov>
Fri, 5 Oct 2012 19:33:58 +0000 (19:33 +0000)
committerPhil Miller <phil@login2.surveyor.alcf.anl.gov>
Fri, 5 Oct 2012 19:33:58 +0000 (19:33 +0000)
src/xlat-i/sdag/CSdagConstruct.C

index cc24bcfd547f9056e4a82fa9062e2368594edb9f..1b573e5a7145451061518e6e7cee2d403e53f813 100644 (file)
@@ -11,7 +11,6 @@ using std::list;
 using std::for_each;
 #include <functional>
 using std::mem_fun;
-using std::bind2nd;
 
 namespace xi {
 
@@ -306,12 +305,12 @@ void SdagConstruct::generateConnectEntries(XStr& decls) {
    decls << "  }\n";
 }
 
-void SdagConstruct::generateConnectEntryList(std::list<SdagConstruct*>& ConnectEList) {
+void SdagConstruct::generateConnectEntryList(list<SdagConstruct*>& ConnectEList) {
   if (type == SCONNECT)
      ConnectEList.push_back(this);
   if (constructs != 0) {
-    for_each(constructs->begin(), constructs->end(),
-             bind2nd(mem_fun(&SdagConstruct::generateConnectEntryList), ConnectEList));
+    for (list<SdagConstruct*>::iterator iter = constructs->begin(); iter != constructs->end(); ++iter)
+      (*iter)->generateConnectEntryList(ConnectEList);
   }
 }
 
@@ -1562,8 +1561,8 @@ void SdagConstruct::generateRegisterEp(XStr& defs)
     defs << "    (void)_sdag_idx_" << traceName << "();\n";
   }
 
-  for_each(constructs->begin(), constructs->end(),
-           bind2nd(mem_fun(&SdagConstruct::generateRegisterEp), defs));
+  for (list<SdagConstruct*>::iterator iter = constructs->begin(); iter != constructs->end(); ++iter)
+    (*iter)->generateRegisterEp(defs);
   if (con1) con1->generateRegisterEp(defs);
   if (con2) con2->generateRegisterEp(defs);
   if (con3) con3->generateRegisterEp(defs);