POV-Ray : Newsgroups : povray.off-topic : A question about Java generics (not a flame) : Re: A question about Java generics (not a flame) Server Time
7 Sep 2024 19:13:06 EDT (-0400)
  Re: A question about Java generics (not a flame)  
From: Fredrik Eriksson
Date: 15 May 2008 13:06:12
Message: <op.ua7ggm1d7bxctx@e6600>
On Thu, 15 May 2008 14:49:55 +0200, Warp <war### [at] tagpovrayorg> wrote:
> Fredrik Eriksson <fe79}--at--{yahoo}--dot--{com> wrote:
>> Now make a small change to main.cpp:
>
>> // main.cpp
>>    export template <typename T> void f();
>
>>    #include "g.hpp"
>>    template <> void g(int i) { /* Do something completely different */ }
>
>>    int main(){ f<int>(); }
>> // end main.cpp
>
>   I don't see how this causes a problem described earlier. This simply
> requires main.cpp to be recompiled (after all, it's the one which has
> been changed), which will result in a new object file which does not
> use the export template.

What? The exported template 'f' is still used. Only 'g' is changed.


>   Why would this cause the need to recompile the export template for
> each usage in the program?

It forces the exported template to be recompiled whenever you change any  
translation unit that instantiates it.



-- 
FE


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.