I 'm fairly new to C++ programming. I wanted to accept a datatype as an input. I've seen something similar while working with the <queue> library.
when defining a new object of queue
how is <int> handled ??
std::queue<typename> is a template. It tells the compiler how to build the object at compile time instead of hard coding a class which handles only one datatype.
In this example, you are creating a queue of integers. If you did this:
you would create a queue of floats.