
Am 11.10.2010 01:59, schrieb Ryan McConnehey:
Is what I'm attempting possible?
Ryan
Hi, yes it is, but you need to pass the template-parameters: Sorter<int, 8> shell(boost::bind(quicksort<int, 8>, _1)); or simply Sorter<int, 8> shell(quicksort<int,8>); Regards, michi7x7
template<typename T, std::size_t U> class Sorter { private: typedef boost::function<void(boost::array<T, U> & a)> t_SortFunction;
t_SortFunction m_SortFunction;
public: Sorter(t_SortFunction func) : m_SortFunction(func) {}
bool sort(boost::array<T, U> & a) { m_SortFunction(a); } };
template<typename T, std::size_t U> void quicksort(boost::array<T, U> & a) { }
int main(int argc, char* argv[]) {
Sorter shell(boost::bind(quicksort, _1));
return 0; }
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users