Hi Andreas, Gerrit,

Andreas Zieringer wrote:
>> On Sat, 2007-03-24 at 14:44 +0100, Andreas Zieringer wrote:
>>> would this
>>>
>>> UInt32 ackNum = (UInt32) osgsqrt(Real32(_sockets.size()));
>>>
>>> fix the problem without re-ordering the templates?
>> until somebody somewhere calls osgsqrt with non float/double
>> arguments. So I would prefer to fix the template order.
>>
>> Or is there anything why we should not ?
> 
> no not really, well I don't trust this template stuff perhaps with the 
> next gcc version it behaves again different. Perhaps we should change both.

I don't think there is a problem with gcc, it's just our code has a bug:
The OSGBaseFunctions.h header only declares the template, and in the 
.inl file the definition of the template comes before the definitions of 
the concrete type functions. Thus when instantiating the template and 
reaching the osgSqrt call inside it the concrete type functions are not 
visible, but only the template is -> recursion.
However, I'm a bit puzzled why this does not trigger some error, 
possibly about excessive template nesting.
So, if the template definitions are moved behind the concrete type 
functions the complete overload set is visible inside the template and 
everything should work as expected.

        Carsten

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to