Hi,

Julien Puydt a écrit :
> Kurosu a écrit :
>> This one seems rather nice (at least it confirms my belief it should be
>> a template):
>> http://www.gamedev.net/reference/programming/features/enginuity2/page5.asp
> 
> I'm not convinced the author wrote and maintained that much C++ code :

I haven't either, hence my requesting some comments. But please bear in
mind that, probably being the one to do the implementation, I'm aiming
for the best time spend/probability of bug ratio, not a computer science
perfection.

> - the functors are pretty primitive : what about functors with 
> arguments? (answer: not supported)  What happens if the stored pointer 
> becomes invalid? (answer: segfault) ...

This can be seen as a general idea of the quality of this code, but I'm
not so much interested in the particular than the overall idea...

> - the singleton tries to use a "cunning trick" which is probably very 
> wrong ; I suggest having a look at the C++ FAQ lite to find better 
> examples and explanations why they're not that good!

...hence my referring to the templating being the first and important
idea. However obvious this idea is to you, I wanted to point out that
(although putting it inside parenthesis was not putting it forward).

> - the ring buffer looks pretty inelegant : why does it take a type and a 
> size as template argument? I would have had a single template argument 
> for the type and used a constructor from an existing normal buffer...

Well, I'm not even looking to this code. La Palice could have said as
much, but I'm more interested in the interesting things than the
uninteresting/irrelevant stuff in that page.

In summary: templating, which should be demonstrated in my next mail &
patch.

Best regards,
-- 
Kurosu

_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev

Répondre à