
2 Jun
2008
2 Jun
'08
2:22 p.m.
Chris Ross escreveu:
Am I missing something about templates that I don't know? Or, is this just not possible with C++ templates, and in which case, can I use one of the boost libraries to help?
Normally in those cases you could create a function to determine the template parameters and pass it to the class. The function then returns a class object correctly instantiated, for instance: (say you renamed your class to detached_all_t) template <class List> detach_all_t<List> detach_all(const List &e) { return detach_all_t<List>(e); } That should do the trick, you can use detach_all without specifying the template parameter. Regards, rod