So given this header.
template <
QSTYPE type,
typename T,
template
class CONT
>
CONT<T> quicksort(CONT<T>);
// inside the main file.
// I decided a function that takes vector of integer and returns a vector of
integer.
typedef boost::function sortfunc;
// create a function list to hold the sorting function.
// bunch of number include.
#include
std::vector<sortfunc> function_list;
using boost::assign::operator+=;
std::vector<sortfunc> function_list;
// quicksort random
function_list += (&algocpw::quicksort),
// quicksort median
(&algocpw::quicksort),
// quicksort mediantriple
(&algocpw::quicksort),
// merge sort
(&algocpw::mergesort),
// heap sort
(&algocpw::heapsort),
// selection sort
(&algocpw::selection_sort),
// standard sort
(&algocpw::standard_sort);
I get the following errors.
./cs512/c++/sortingMain.cpp(63) : error C2896:
'boost::assign::list_inserter>,V>
boost::assign::operator +=(std::vector<_Ty,_Alloc> &,V2)' : cannot use
function template 'CONT<T> algocpw::mergesort(CONT<T>)' as a function
argument
c:\cpw\msvc\cs512\c++\def\../sortingAlgo.hpp(32) : see declaration
of 'algocpw::mergesort'
./cs512/c++/sortingMain.cpp(63) : error C2784:
'boost::assign::list_inserter>,V>
boost::assign::operator +=(std::deque &,V2)' : could not deduce
template argument for 'std::deque &' from 'std::vector<_Ty>'
with
[
_Ty=sortfunc
]
Where did "deque" come from.. i never included deque.