This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Code compiles with g++ 3.3 but not g++ 4.4




> Sorry, my mistake.
> template class Graph<int,int,int>::Graph(int, int, void (*)(char *));
> was wrong;-) the "class" was too much. Try only
> template Graph<int,int,int>::Graph(int, int, void (*)(char *));
> 
> Axel
> 
> 

Ah, great, thanks!
Ok this problem is solved, but it inspired a more general question. I never
understood why you have to explicitly instantiate these template
classes/functions? I thought that NOT knowing which types were going to be
used before hand was kind of the whole point? Why can't the compiler just
figure out which types you are trying to use the template class/function
with and just instantiate it for you?

Thanks,

Dave
-- 
View this message in context: http://www.nabble.com/Code-compiles-with-g%2B%2B-3.3-but-not-g%2B%2B-4.4-tp25929745p25937853.html
Sent from the gcc - Help mailing list archive at Nabble.com.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]