I hav a following piece of code in a module.
Controller is the name of the class.
allocate_route is the member function of it.
While defining the member function it is given as
template<UI num_ip>
void Controller<num_ip>::allocate_route()
{
}
UI is Unsigned Integer. num_ip is not defined any where. He also has not used num_ip anywhere inside the code. What does he tell to the compiler by this statement. Am not able to comprehend the use of templates here. Wat does this code do?
That code implements the function
allocate_routedefined in the template classController.When creating template classes, you have two way to implement functions:
or