You use using namespace std; (get out of that habit) which means that std::min and std::max are pulled in from the std namespace into the global namespace. That is why you can't then use those names in your own code, since they have already been defined.