Mail Archives: djgpp/2001/01/20/18:06:34
"Rafal Maj" <maj_rafal AT poczta DOT onet DOT pl> writes:
> Yes,
> but when definiton (in real program - very long) of my class is in box.h,
> then it is re-compiled every time, with can take very much time.
What Jason Green showed you is the normal way of writing template
classes and their functions...
> I want to
> have definition in other .cc file to re-compile it only when necessary, in
> bug.h I want only definition of my class.
...and this isn't. (I believe you mean "declaration" by the way.)
> When I write definition of normal class in my library *.cc file - OK
> When I write definition of template class in my main *.cc file - OK
> When I write definition of template class in my library *.cc file - error !
That's just the way template classes work, I'm afraid.
(So far as I know anyway.)
Some compilers can "compile the headers" on order to answer
your objection to writing the code correctly, but I don't
think gcc does so yet.
Regards,
Ian
- Raw text -