I have problem with extremely long compiling time on my C++ code where I use some template functions from external library.
Example:
//fun.h
template <class T>
T fun(T in){
...
}
//main.cpp
#include fun.h
class A{...};
int main(){
A a,b;
...
b=fun<A>(a); //this line causes the long compilation time, because fun is really complicated
...
}
I’m thinking about somehow define new function
funA := fun<A>
in separate header file and pre-compile it. So each time I change main.cpp I don’t have to build
fun<A>
again an again. But I have no idea how to do it. I think that with classes you simply put
typedef class<A> classA;
in pre-compiled header and you are done. But how to do it with functions?
wrap_fun.h:wrap_fun.C: