@@ -401,8 +401,8 @@ container_umap_type* get_container_umap(void){
401
401
return &container_umap;
402
402
}
403
403
404
- #define CMAKER (CONTAINER, INSERT, SET_IT, GET_SEG, ERASE ) \
405
- class CONCAT (CONTAINER,Wrapper) : public MyContainer< std::CONTAINER<Segment> > { \
404
+ #define CMAKER (CONTAINER, STRUCT, INSERT, SET_IT, GET_SEG, ERASE ) \
405
+ class CONCAT (CONTAINER,Wrapper) : public MyContainer< STRUCT > { \
406
406
public: \
407
407
void insert (Segment& new_seg){ \
408
408
segment_container.INSERT (new_seg); \
@@ -423,14 +423,25 @@ container_umap_type* get_container_umap(void){
423
423
static ContainerFactory CONCAT (CONTAINER,_instance) \
424
424
( #CONTAINER, CONCAT(CONTAINER,construct), CONCAT(CONTAINER,destruct) );
425
425
426
- #define CIT (CONTAINER, INSERT, BEST ) \
427
- CMAKER (CONTAINER, INSERT, std::CONTAINER<Segment>::iterator it = BEST, *it, segment_container.erase(it))
426
+ #define CIT (CONTAINER, INSERT, BEST ) \
427
+ CMAKER (CONTAINER, std::CONTAINER<Segment>, INSERT, std::CONTAINER<Segment>::iterator it = BEST, *it, segment_container.erase(it))
428
428
429
429
CIT(multiset, insert, segment_container.begin())
430
430
431
431
CIT(list, push_back, std::min_element(segment_container.begin(),segment_container.end()))
432
432
433
- CMAKER(priority_queue, push, , segment_container.top(), segment_container.pop())
433
+ class PQ_Compare {
434
+ public:
435
+ bool operator ()(Segment a, Segment b){
436
+ return !(a < b);
437
+ }
438
+ };
439
+ #define PQ_STRUCT std::priority_queue<Segment,std::vector<Segment>,PQ_Compare>
440
+ CMAKER (priority_queue, PQ_STRUCT, push, , segment_container.top(), segment_container.pop())
441
+ // template <class T, class Container = vector<T>, class Compare = less<typename Container::value_type> >
442
+ // template < class T, // multiset::key_type/value_type class Compare = less<T>, // multiset::key_compare/value_compare class Alloc = allocator<T> > // multiset::allocator_type > class multiset;
443
+
444
+
434
445
435
446
class Candidates {
436
447
public:
0 commit comments