Skip to content

Commit

Permalink
Added more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
LeifMessinger committed Aug 20, 2023
1 parent b35a6c9 commit 7b48ea6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,24 @@ int main()

ArrayStats::getStats(list2.begin(), list2.end()).print();

std::cout << std::endl;

const int num = 4;
const int* list3 = &num;

ArrayStats::getStats(list3, list3+1).print();

std::cout << std::endl;

const int list4[] = {4, 8, 5, 1, 1, 2};

ArrayStats::getStats(&(list4[0]), &(list4[6])).print(); //I don't think the template likes arrays. This should be safe btw

std::cout << std::endl;

const int* list5 = list4;

ArrayStats::getStats(list5, list5 + 6).print(); //It should be fine with pointer arrays tho

return 0;
}

0 comments on commit 7b48ea6

Please sign in to comment.