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 21:12:59 EDT (-0400)
  Re: A question about Java generics (not a flame)  
From: Warp
Date: 15 May 2008 12:12:17
Message: <482c60e1@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> foo.cc:
> export template<typename T>
> void foo(T t) { bar(t); }

>   I see how that could make some difference.

  OTOH, thinking about it: There's no function named 'bar' defined anywhere
in the scope of foo.cc, so why should that even compile?

  I have to admit I don't know if the C++ standard requires the environment
of the instantation of the template when compiling the template function or
not. Personally I wouldn't find it illogical if foo.cc above would cause
a compiler error because, after all, there's no 'bar()' function defined
there.

-- 
                                                          - Warp


Post a reply to this message

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