Compilation Errors !
Hi
I am getting the compile time errors while running a Project. The project is being ported from Windows Platform to Linux.
//Contents of File - persistentvector.h
------------------------------------------------------
#include "allocator.h"
template <class _Tp, class _Alloc = AllocatorInterface<_Tp> > class persistentvector
: public CPersists,public vector<_Tp ,_Alloc>
{
typedef persistentvector< _Tp, _Alloc > _Mypersistent;
public :
typedef _Tp value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef size_t size_type;
typedef pointer _Tptr;
typedef __gnu_cxx:: __normal_iterator< pointer,_Mypersistent > iterator;
typedef __gnu_cxx:: __normal_iterator< const_pointer,_Mypersistent > const_iterator;
typedef iterator _It;
Also thr are some of the functions like insert defined in this file.....
//Contents of File - typedefs.h
------------------------------------------------------
#include "persistentvector.h"
typedef persistentlist<CCktElem*,allocator<CCktElem*> >::iterator LIST_ITERATOR;
typedef persistentvector<CCktElem*, allocator<CCktElem*> >::iterator VECTOR_ITERATOR;
typedef persistentvector <CCktElem*,allocator<CCktElem*> > CKTELEM_DARRAY;
typedef persistentlist<CCktElem*, allocator<CCktElem*> > CKTELEM_LIST;
typedef persistentlist<CCktElem*,allocator<CCktElem*> >* PTR_CKTELEM_LIST;
typedef persistentvector<CCktElem*,allocator<CCktElem*> >* PTR_CKTELEM_DARRAY;
--------------------------------------------------------------------------
//Contents of File - ClogicElem.h
-------------------------------------------
#include "typedefs.h"
#include<CCktElem.h>
class CLogicElem : public CCktElem{
protected:
CLogicElem(unsigned int id): CCktElem(id)
{
#ifdef _DEBUG
m_pDBGCktElemName = NULL;
m_pDBGSourceList = NULL;
m_pDBGSinkList = NULL;
m_bDBGVisitedFlg = false;
#endif
}
LIST_ITERATOR Begin(PTR_CKTELEM_LIST pListPtr);
LIST_ITERATOR End(PTR_CKTELEM_LIST pListPtr);
VECTOR_ITERATOR Begin(PTR_CKTELEM_DARRAY pVectorPtr);
VECTOR_ITERATOR End(PTR_CKTELEM_DARRAY pVectorPtr);
};
inline LIST_ITERATOR CLogicElem::Begin(PTR_CKTELEM_LIST pListPtr)
{
return pListPtr->begin();
}
inline LIST_ITERATOR CLogicElem::End(PTR_CKTELEM_LIST pListPtr)
{
return pListPtr->end();
}
inline VECTOR_ITERATOR CLogicElem::Begin(PTR_CKTELEM_DARRAY pVectorPtr)
{
return pVectorPtr->begin();
}
inline VECTOR_ITERATOR CLogicElem::End(PTR_CKTELEM_DARRAY pVectorPtr)
{
return pVectorPtr->end();
}
The errors are obtained in the above function having return type VECTOR_ITERATOR. These begin and end functions are giving following compile time errors:
Errors:
conversion from `_gnu_cxx::__normal_iterator<CCktElem**, std::vector<CCktElem*,
std::allocator<CCktElem*> > >' to non-scalar type `
__gnu_cxx::__normal_iterator<CCktElem**, persistentvector<CCktElem*,
std::allocator<CCktElem*> > >' requested
In member function 'VECTOR_ITERATOR CLogicElem::End(persistentvector<CCktElem*,
std::allocator<CCktElem*> >*)':
conversion from `__gnu_cxx::__normal_iterator<CCktElem**, std::vector<CCktElem*,
std::allocator<CCktElem*> > >' to non-scalar type `VECTOR_ITERATOR'
requested
Though the similar functions having the return type LIST_ITERATOR are working fine.
Its just very difficult to track the exact problem.
Can any one give a push !
-vipinsharma
|