D - classes vs structs
- imr1984 <imr1984_member pathlink.com> Jan 16 2004
- J Anderson <REMOVEanderson badmama.com.au> Jan 16 2004
- Stephan Wienczny <wienczny web.de> Jan 16 2004
- imr1984 <imr1984_member pathlink.com> Jan 18 2004
Im not quite sure how to decide about wether to use a struct or a class for a linked list im making. Each node encapsulates a cvar for a quake like console. The advantages of a class is that i dont need to use pointer syntax, cos everything is by reference anyway. But its gonna be a light weight object so maybe i should use a struct?
Jan 16 2004
imr1984 wrote:Im not quite sure how to decide about wether to use a struct or a class for a linked list im making. Each node encapsulates a cvar for a quake like console. The advantages of a class is that i dont need to use pointer syntax, cos everything is by reference anyway. But its gonna be a light weight object so maybe i should use a struct?
light weight. But you can encapsulate that in a class. Also you might consider making it a template so you can reuse it. ie instead of having cvar at each node, allow the user to specify anything.
Jan 16 2004
J Anderson wrote:imr1984 wrote:Im not quite sure how to decide about wether to use a struct or a class for a linked list im making. Each node encapsulates a cvar for a quake like console. The advantages of a class is that i dont need to use pointer syntax, cos everything is by reference anyway. But its gonna be a light weight object so maybe i should use a struct?
light weight. But you can encapsulate that in a class. Also you might consider making it a template so you can reuse it. ie instead of having cvar at each node, allow the user to specify anything.
If he needs one he could have mine... I wrote a template linked list ones. It has all basic features... Append, Prepend, Insert, Find etc. As there are no generic foreach's, I had to write Iterators There is only one prob, I did not have much time for testing... Stephan
Jan 16 2004
In article <bua7tc$2tvm$1 digitaldaemon.com>, Stephan Wienczny says...J Anderson wrote:imr1984 wrote:Im not quite sure how to decide about wether to use a struct or a class for a linked list im making. Each node encapsulates a cvar for a quake like console. The advantages of a class is that i dont need to use pointer syntax, cos everything is by reference anyway. But its gonna be a light weight object so maybe i should use a struct?
light weight. But you can encapsulate that in a class. Also you might consider making it a template so you can reuse it. ie instead of having cvar at each node, allow the user to specify anything.
If he needs one he could have mine... I wrote a template linked list ones. It has all basic features... Append, Prepend, Insert, Find etc. As there are no generic foreach's, I had to write Iterators There is only one prob, I did not have much time for testing... Stephan
Yeah host it on a website and ill test it. Who knows maybe if its good enough it could go into Phobos :)
Jan 18 2004








imr1984 <imr1984_member pathlink.com>