Changeset 3403


Ignore:
Timestamp:
Mar 31, 2015, 7:18:45 AM (8 years ago)
Author:
Peter
Message:

add constructor that takes compare functor

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/priority_queue.cc

    r3399 r3403  
    9090  workers.join_all();
    9191  suite.out() << "\n";
     92
     93  typedef std::greater<std::string> MyComp;
     94  MyComp comp;
     95  PriorityQueue<std::string, MyComp> queue2(comp);
     96  queue2.push("hello");
     97
    9298  return suite.return_value();
    9399}
  • trunk/yat/utility/PriorityQueue.h

    r3399 r3403  
    6767    */
    6868    PriorityQueue(void) {}
     69
     70    /**
     71       \brief Create a PriorityQueue with \a comp as Compare functor
     72    */
     73    explicit PriorityQueue(const Compare& comp) : q_(comp) {}
    6974
    7075    /**
Note: See TracChangeset for help on using the changeset viewer.