From 95d2869136893bf0a03317fa95901c7d9f38c203 Mon Sep 17 00:00:00 2001 From: Matthew Ellison Date: Fri, 9 Nov 2018 15:42:27 -0500 Subject: [PATCH] Fixed sort problem and added declarations to the front of the file --- Algorithms.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Algorithms.hpp b/Algorithms.hpp index 9c35b38..8598286 100644 --- a/Algorithms.hpp +++ b/Algorithms.hpp @@ -14,6 +14,18 @@ namespace mee{ +//A list of functions in the file +//Also works as a declaration +template +std::vector getPrimes(T goalNumber); +template +std::vector getDivisors(T num); +template +T getSum(std::vector numbers); +template +bool isFound(T num, std::vector list); + + template std::vector getPrimes(T goalNumber){ std::vector primes; @@ -48,7 +60,7 @@ std::vector getPrimes(T goalNumber){ foundFactor = false; } } - std::sort(primes.front(), primes.end()); + std::sort(primes.begin(), primes.end()); return primes; } @@ -68,7 +80,7 @@ std::vector getDivisors(T num){ } } } - std::sort(divisors.front(), divisors.end()); + std::sort(divisors.begin(), divisors.end()); return divisors; }