Commits

Nathan Goldbaum committed 99c4c11

Moving the comparison functors outside of global scope.

Comments (0)

Files changed (1)

src/enzo/particles/active_particles/ActiveParticle_GMCParticle.C

 #define MYR       (1.0e6*YR)
 #define MSTARMEAN 0.21
 
+struct sort_pfirst {
+  bool operator()(const std::pair<float,float> &left, const std::pair<float,float> &right) {
+    return left.first < right.first;
+  }
+};
+
+struct pair_add {
+  float operator()(float lhs, const std::pair<float, float>& x) {
+    return lhs + x.first;
+  }
+};
+
 void ActiveParticleType_GMCParticle::CreateHIIregions() {
   float Massocremain;
   int nstarProb, starPtr=0, nstarMem, nstar;
   float m, tms = 0, Lvtot = 0, Lboltot = 0, s49tot = 0, s49sum = 0, tmscut;
 
-  struct sort_pfirst {
-    bool operator()(const std::pair<float,float> &left, const std::pair<float,float> &right) {
-      return left.first < right.first;
-    }
-  };
-
-  struct pair_add {
-    float operator()(float lhs, const std::pair<float, float>& x) {
-      return lhs + x.first;
-    }
-  };
- 
-  /* Increase the mass of stars available to ho into a cluster, stored
+  /* Increase the mass of stars available to go into a cluster, stored
      in solar masses. */
   MstarRemain += (-MdotStar)*M0*dtau/SolarMass;
 
       }
 
     }
+
     /* Generate next association mass */
     Massoc = Massocgen(M*M0);