I intend to have different sorting criterias predicate classes as follows
// Generic interfcae for sorting design blocks of any type
class CCL_BlockSorter
{
public:
// Predicate for sorting block of any type
virtual bool operator () () = 0;
protected:
private:
} ;
//--------------------------SPECIALISED CASE -----------------------------------
class CCL_BlockSorter_Degree:public CCL_BlockSorter
{
public:
virtual bool operator () () ;
protected:
private:
} ;
why doesnt the following line of code compiles ?
PQ_MACRO_GENERIC * pBlockDegreeSorter = new PQ_MACRO_DEGREE ( new priority_queue< CCL_MacroBlock *,
MACRO_BLK_LIST ,MACRO_SORTER_DEGREE > () ) ;
Where following are the typedefs used
typedef CCL_BlockSorter MACRO_SORTER_GENERIC ;
typedef CCL_BlockPriorityQueue<CCL_MacroBlock,MACRO_SORTER_GENERIC * > PQ_MACRO_GENERIC ;
It's because all of your typedefs are making the problem harder to see.
PQ_MACRO_DEGREE is a typedef for a CCL_BlockPriorityQueue<> template instantiation whose last template parameter is a pointer to a CCL_BlockSorter_Degree.
But your new PQ_MACRO_DEGREE line passes is MACRO_SORTER_DEGREE as the last template parameter, which is not a pointer.