Assuming this is my library. And it is a very huge library:
library.hpp
template<class usertype> void function_name(usertype aaa)
{
}
This is my main
int main()
{
int x=3;
function_name(x);
double y=3.5;
function_name(y);
return 0;
}
I do not know what is going inside the library. What I want is to convert the library to adapt my code. In fact, reducing the template into real code.
I need the library code above be converted into:
void function_name(int aaa)
{
}
void function_name(double aaa)
{
}
So I can manipulate the library according to my needs instead of manipulating the general code that works for everybody. How can this conversion from template to real code be done (without manual effort, but in automatic way)?
Edit:
I want to convert the whole file library.hpp
into library_2.hpp
which contains no template. Instead with two real implemented functions. This is what happens in the middle of the compilation.
I am not looking for reducing the compilation time. I am dealing with a huge library made of 196 files. Among those many functions in the library, I will need a few of them related to my work. I intend to hack and extend this library. Extending the whole library has huge effort cost for me. I just want to extend only what I need. So, it is very important for me to reduce the code and simplify it and remove all templates replacing them with explicit code. I am not good at C++ and it compiler errors. So, in such a huge library, I prefer to use automatic methods rather than involving manual code manipulation. I am also not good at understanding this library. To understand the library, better to convert its complicated functions into explicit implemented code related to what I really need. Then I can understand someones else code better. I will remove the functions not related to my needs. I also do not care about updates coming to the library. Once I establish new library, its maintenance is my duty. And the new library would be much smaller and easier for maintenance. Comments show that some people looking at my aim from different view. I hope this explanation is clear.
In case of curiosity, the library I am going to manipulate is odeint related to mathematical computations with rarely change or bug inside.