Hierarchy with `list` type
You might prefer to not use polymorphism at all if you want to make sure that your types remain unique. Consider something more like:

class Node
{
private:
    list&lt;Node*&gt; children ;
    int v ;

public:
    Node( int iv ) : v(iv) { }

    void add( Node* child )
    {
        children.push_back( child );
    }

    void print( const char* msg )
    {
        printf( "REGULAR CHILD %d in %s\n", v, msg );
        for( Node *sn : Node::children )
        {
            sn-&gt;print( "regular" );
        }
    }
};

class SpecialNode // no inheritance
{
private:
    list&lt;SpecialNode*&gt; children;
    int v;

public:
    SpecialNode( int iv ) : v(iv) {}
    void add( SpecialNode* child )
    {
        children.push_back( child ) ;
    }

    void print( const char* msg )
    {
        printf( "SPECIAL CHILD %d in %s\n", v, msg ) ;
        for( SpecialNode *sn : children )
            sn-&gt;print( "special" ) ;
    }
};

class Composite // no inheritance
{
private:
    Node nodes;
    SpecialNode specialNodes;

public:
    Composite( int iv ) : nodes(iv), specialNodes(iv)
    void addSpecial( SpecialNode* child )
    {
        specialNodes.add( child ) ;
    }
    void add( Node * child)
    {
        nodes.add(child);
    }

    void print( const char* msg )
    {
        nodes.print(msg);
        specialNodes.print(msg);
    }
};