Hi Guys,
I am really not sure whether the applied method has solved my problem or not. Though to some extent i feel that this was the problem of the syntha
Quote:
--------------------------------------------------------------------------------
Hi,
I have finally solved the problem.
the statement :
typedef persistentlist<CCktElem*>::iterator LIST_ITERATOR;
had an argument missing because it is considered as a default parameter (since it is assigned a Default value during the double argument template Defintion). But in Linux we need to mention that also.
typedef persistentlist<CCktElem*, allocator<CCktElem*>>::iterator LIST_ITERATOR;
That solves the problem.
--------------------------------------------------------------------------------
|
I am not sure whether this has solved the problem or not. I am no more getting any kind of parse errors but still facing problem at other places where this VECTOR_ITERATOR user defined data type has been used. Though LIST_ITERATOR is working absolutely fine.
To address the problem in better manner :
In the source code :
//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.
Is it because of the definition of the VECTOR_ITERATOR that i am facing some problem or is there some kind of error in the definition of the term 'iterator' which is under the class persistentvector defined.
Plz guide me guys