I just don't get it. If I declare it in the .cpp, it works. If I remove the default parameter (changing it to just "bool sold"), it works. But this will not compile in the .h.
Queue<string> analyzeQueue(Queue<Stock> holding, bool sold = false);
Error: cannot overload functions distinguished by return type alone
overloaded can only mean one thing, there is more than one of them and they have the same parameter types.
check the header files that you include.
if its a class method check the base class.
check the rest of the output from the compiler, almost all compilers show you where they found the declarations.
1 2 3 4 5
1> test.cpp
1>c:\dev\my_projects\consoleapplication1\pool.cpp(5): error C2556: 'float analyzeQueue(int,bool)' : overloaded function differs only by return type from 'int analyzeQueue(int,bool)'
1> c:\dev\my_projects\consoleapplication1\test.h(3) : see declaration of 'analyzeQueue'
1>c:\dev\my_projects\consoleapplication1\test.cpp(5): error C2371: 'analyzeQueue' : redefinition; different basic types
1> c:\dev\my_projects\consoleapplication1\test.h(3) : see declaration of 'analyzeQueue'