#include #include #include #include #include "date.h" #include "sorter.h" using namespace std; template void print(ITERATOR first, ITERATOR last) { for (; first != last; ++first) { cout << *first << "\n"; } } int main() { int a1[] = {10, 30, 20, 50, 40}; const size_t n1 = sizeof a1 / sizeof a1[0]; sorter(a1, a1 + n1); print(a1, a1 + n1); cout << "\n"; const date a2[] = { date(date::october, 29, 1929), date(date::july, 20, 1969), date(date::july, 4, 1776), date(date::september, 11, 2001), date(date::december, 7, 1941) }; const size_t n2 = sizeof a2 / sizeof a2[0]; vector v(a2, a2 + n2); sorter(v.begin(), v.end()); print(v.begin(), v.end()); cout << "\n"; list li(a2, a2 + n2); //sorter(li.begin(), li.end()); //won't compile li.sort(); print(li.begin(), li.end()); return EXIT_SUCCESS; }