Boost logo

Boost Users :

From: Rodolfo Lima (rodolfo_at_[hidden])
Date: 2008-06-02 10:22:42


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net