I am getting am error while doing the project | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I am getting am error while doing the project

The queue management 4 project makes you use template specialization for the code to work but when i use , template<> class Queue<string> {....}; It gives me an error: "Queue" is not a class template. Can anyone help me figure out what i am doing wrong?

19th Nov 2020, 5:01 PM
Soumojit Chowdhury
Soumojit Chowdhury - avatar
2 Answers
+ 2
Sounds like you are trying to specialize Queue although the original class is not templated. Did you leave the original class definition unchanged? It might be helpful if you copied the code into a project and linked that project here so others can inspect the code. However, note that template specialization is not required to solve the exercise.
19th Nov 2020, 5:18 PM
Shadow
Shadow - avatar
0
Well yes i did template the original Queue class as well but it didn't help. But ome thing you are right about is that the problem doesn't require specializtion template, normal template will work. I took that in my mind and tried to find the solution and it turned out i was making it more complicated than it should be , so only 4 changes in the default code was enough to finish the project.. Thanks for the suggestion
19th Nov 2020, 7:11 PM
Soumojit Chowdhury
Soumojit Chowdhury - avatar