fork download
#include 

class Collection {
public:
    Collection() {
    }
    virtual ~Collection() {
    }
    virtual void add(const Collection& c) {
        printf("Added c elements here\n");
    }
};
class Set: public Collection {
public:
    Set() {
    }
    virtual ~Set() {
    }
};
class SortedSet: public Set {
public:
    SortedSet() {
    }
    virtual ~SortedSet() {
    }
};

int main(){
  Set *s = new Set();
  SortedSet *ss = new SortedSet();
  ss->add(*s);
  return 0;
}
Success #stdin #stdout 0s 2984KB
stdin
Standard input is empty
stdout
Added c elements here