c# - Get all nodes in a tree -


i have little issue following program

internal ienumerable<t> getitems<t>(string nodename) t : root, new() {     var node = new t();     return getitems(nodename, node).cast<t>(); }  public ienumerable<root> getitems(string nodename, root root) {     // } 

i know how change c++ code. have tried

template<class t> list<t> getitems(string nodename) {     auto node = new t();     return getitems(nodename, node); }  list<root> getitems(string nodename, root root) {     // } 

now mess little

typedef shared_ptr<root> root_ptr; class smallroot:public root{}; list<root_ptr> getitems(string nodename, root_ptr rootptr) {     //do , return list of share pointers       } 

then stuck @ how redesign template getitems feed smallroot classes


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -