msgQ: user iterator for appropriate container (map/unordered_map)
authorRamprasad Venkataraman <ramv@illinois.edu>
Sun, 28 Oct 2012 13:37:25 +0000 (08:37 -0500)
committerRamprasad Venkataraman <ramv@illinois.edu>
Sun, 28 Oct 2012 13:37:25 +0000 (08:37 -0500)
src/conv-core/msgq.h

index fe77f0ff930e3b852cae89b5358f7e4c2671f7fc..bb5946e5e27ae8d69b3c3e9355f7c23e8b16bb27 100644 (file)
@@ -107,7 +107,12 @@ void msgQ<P>::enq(const msg_t *msg
                  )
 {
     // Find index of / create the bucket holding msgs of this priority
                  )
 {
     // Find index of / create the bucket holding msgs of this priority
-    typename std::map<prio_t, bktidx_t>::iterator itr = prio2bktidx.find(prio);
+    #if CMK_HAS_STD_UNORDERED_MAP
+    typename std::unordered_map<prio_t, bktidx_t>::iterator
+    #else
+    typename std::map<prio_t, bktidx_t>::iterator
+    #endif
+    itr = prio2bktidx.find(prio);
     bktidx_t bktidx;
     if (prio2bktidx.end() != itr)
         bktidx = itr->second;
     bktidx_t bktidx;
     if (prio2bktidx.end() != itr)
         bktidx = itr->second;