Typedef vs. Class

Started by
9 comments, last by JIMbond21 20 years ago
quote:Original post by Jiia
There will be no difference. Neither is more professional. If you later decide your typedef needs more than 3 or 4 member functions, then switch it to a class. There should be no change in behavior at all.

quote:Original post by GroZZleR
I wouldn''t use a linked list. You''ll get much better performance from an dynamically created array. Mark dead particles as ''dead'' and reuse them, rather then continually scour the list.

Why is that? With an array, you have to continually scour the list for living particles. Performance with a linked list really depends on the life of the particles, and how often they enter and exit the world. An array on the other hand would always have to skip over dead particles.


I''ll take a single if statement over theoretically hundreads of new and deletes every frame. =)

This topic is closed to new replies.

Advertisement