• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Use a template of Type 'A' within 'A'

tatteredpotato

Diamond Member
For Example I tried:

class TreeNode
{
public:
vector<TreeNode> children;
etc.....
};

This gives me an error stating:

ISO C++ forbids declaration of vector with no type.

How would I go about doing this?

EDIT: For the record it's the same error as giving:

vector<sfkljwoisjdfks> children;

In other words it's not recognizing the TreeNode type within TreeNode.

EDIT 2: I'm a noob, I forgot the "using namespace std;"
 
Back
Top