Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

migrate from VC6 to VC8, getting errors

pnagarpnagar Member Posts: 2
I'm trying to compile this code, which is part from Stingray tools:

#include

#include

#include

#include



namespace stingray {

namespace foundation {



// Disable the warning that complains about the symbols name length

#pragma warning(disable: 4786)



//@doc

//@class CComposite |

/*

Implements the composite design pattern

*/

//@tcarg typename | _Component | Type of the elements in the composite structure

//@tcarg GUID | guid | GUID that identifies the Composite interface among all the interfaces implemented by an element

template

class CComposite:

public IQueryGuid

{

typedef CComposite<_Component, _guid> _thisClass;

typedef std::list<_Component* > Children;

class CompIterator:

public Iterator

{

public:

friend class _thisClass;

explicit CompIterator(Children& acoll): foundation::Iterator(acoll) {}

};



public:

typedef foundation::IteratorBase<_Component*> Iterator;

// Composite design pattern operations

//@cmember

// Returns the number of nodes directly contained in this node

int GetChildrenCount () const;

//@cmember

// Returns the total number of nodes contained by this node and its children

int GetAllDescendantsCount () const;



//@cmember

// Returns this node's parent

_Component* GetParent() const;

//@cmember

// Sets the parent node

void SetParent(_Component* pComp);

//@cmember

// Returns the root of the composite tree

_Component* GetRoot();

//@cmember

// Adds a node as a child of this node

int AddChild(_Component* pComp);

//@cmember

// Removes a child node

int RemoveChild(_Component* pComp);

//@cmember

// Returns an iterator of this node's children

Iterator* GetChildIterator();

protected:

CComposite(): m_pParent(NULL) {}

virtual ~CComposite() {}

protected:

// Composite design pattern implementation

Children m_Children;

_Component* m_pParent;

};


on VS 2005 and I'm getting this warning and those errors: Previously it was successfully building on Visual Studio 6.0.


Warning 3 warning C4346: 'std::list<_Component*>::iterator' : dependent name is not a type e:stingrayincludefoundationpatternscomposite.h Line 51

Error 4 error C2923: 'stingray::foundation::Iterator' : 'std::list<_Component*>::iterator' is not a valid template type argument for parameter '_Iter' e:stingrayincludefoundationpatternscomposite.h Line 51


Could you help us to resolve this errors?

We tried lot of efforts into tis but didnt get solution.

Comments

  • IDKIDK Member Posts: 1,784
    : I'm trying to compile this code, which is part from Stingray tools:
    :
    : #include
    :
    : #include
    :
    : #include
    :
    : #include
    :
    :
    :
    : namespace stingray {
    :
    : namespace foundation {
    :
    :
    :
    : // Disable the warning that complains about the symbols name length
    :
    : #pragma warning(disable: 4786)
    :
    :
    :
    : //@doc
    :
    : //@class CComposite |
    :
    : /*
    :
    : Implements the composite design pattern
    :
    : */
    :
    : //@tcarg typename | _Component | Type of the elements in the composite structure
    :
    : //@tcarg GUID | guid | GUID that identifies the Composite interface among all the interfaces implemented by an element
    :
    : template
    :
    : class CComposite:
    :
    : public IQueryGuid
    :
    : {
    :
    : typedef CComposite<_Component, _guid> _thisClass;
    :
    : typedef std::list<_Component* > Children;
    :
    : class CompIterator:
    :
    : public Iterator
    :
    : {
    :
    : public:
    :
    : friend class _thisClass;
    :
    : explicit CompIterator(Children& acoll): foundation::Iterator(acoll) {}
    :
    : };
    :
    :
    :
    : public:
    :
    : typedef foundation::IteratorBase<_Component*> Iterator;
    :
    : // Composite design pattern operations
    :
    : //@cmember
    :
    : // Returns the number of nodes directly contained in this node
    :
    : int GetChildrenCount () const;
    :
    : //@cmember
    :
    : // Returns the total number of nodes contained by this node and its children
    :
    : int GetAllDescendantsCount () const;
    :
    :
    :
    : //@cmember
    :
    : // Returns this node's parent
    :
    : _Component* GetParent() const;
    :
    : //@cmember
    :
    : // Sets the parent node
    :
    : void SetParent(_Component* pComp);
    :
    : //@cmember
    :
    : // Returns the root of the composite tree
    :
    : _Component* GetRoot();
    :
    : //@cmember
    :
    : // Adds a node as a child of this node
    :
    : int AddChild(_Component* pComp);
    :
    : //@cmember
    :
    : // Removes a child node
    :
    : int RemoveChild(_Component* pComp);
    :
    : //@cmember
    :
    : // Returns an iterator of this node's children
    :
    : Iterator* GetChildIterator();
    :
    : protected:
    :
    : CComposite(): m_pParent(NULL) {}
    :
    : virtual ~CComposite() {}
    :
    : protected:
    :
    : // Composite design pattern implementation
    :
    : Children m_Children;
    :
    : _Component* m_pParent;
    :
    : };
    :
    :
    : on VS 2005 and I'm getting this warning and those errors: Previously it was successfully building on Visual Studio 6.0.
    :
    :
    : Warning 3 warning C4346: 'std::list<_Component*>::iterator' : dependent name is not a type e:stingrayincludefoundationpatternscomposite.h Line 51
    :
    : Error 4 error C2923: 'stingray::foundation::Iterator' : 'std::list<_Component*>::iterator' is not a valid template type argument for parameter '_Iter' e:stingrayincludefoundationpatternscomposite.h Line 51
    :
    :
    : Could you help us to resolve this errors?
    :
    : We tried lot of efforts into tis but didnt get solution.
    :
    :

    Use code tags (look at stylecodes right below the post reply button), and which line is which?
Sign In or Register to comment.