Fixed sort problem and added declarations to the front of the file

This commit is contained in:
2018-11-09 15:42:27 -05:00
parent e77e66ef86
commit 95d2869136

View File

@@ -14,6 +14,18 @@
namespace mee{ namespace mee{
//A list of functions in the file
//Also works as a declaration
template<class T>
std::vector<T> getPrimes(T goalNumber);
template<class T>
std::vector<T> getDivisors(T num);
template <class T>
T getSum(std::vector<T> numbers);
template<class T>
bool isFound(T num, std::vector<T> list);
template<class T> template<class T>
std::vector<T> getPrimes(T goalNumber){ std::vector<T> getPrimes(T goalNumber){
std::vector<T> primes; std::vector<T> primes;
@@ -48,7 +60,7 @@ std::vector<T> getPrimes(T goalNumber){
foundFactor = false; foundFactor = false;
} }
} }
std::sort(primes.front(), primes.end()); std::sort(primes.begin(), primes.end());
return primes; return primes;
} }
@@ -68,7 +80,7 @@ std::vector<T> getDivisors(T num){
} }
} }
} }
std::sort(divisors.front(), divisors.end()); std::sort(divisors.begin(), divisors.end());
return divisors; return divisors;
} }