Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] Re: curiosity
Home

[Freeciv-Dev] Re: curiosity

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Justin Moore <justin@xxxxxxxxxxx>, Freeciv Developers <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: curiosity
From: Andrew Sutton <ansutton@xxxxxxx>
Date: Sun, 2 Dec 2001 17:47:27 -0500

On Sunday 02 December 2001 12:42 pm, Justin Moore wrote:
>    Until you get it into a debugger.  Have you ever tried to follow the
> STL around in gdb?  That *alone* should be a reason NOT to use the STL
> (not necessarily C++, just the STL).

that's not really a reasonable discouragement for using stl. granted, it may 
be kind of hard to figure out, but once you get used to it, it's not to 
tough. besides, with stl, the hardes thing to figure out is going to be const 
casting of pointers and references from within containers.


>    Agreed.  When used properly and in a controlled environment, void* can
> be used effectively as an abstraction mechanism without a lot of the nasty
> C++ overhead.

sorry. void ptrs are a fallback mechanism when you can't think to make 
anything else work. *good* code (c or c++) will be able to avoid using void 
ptrs all together (except for raw memory operations like new, delete, memcpy 
and malloc).

the primary reason you should never use void pointers is that they are 
completely type-unsafe. like i said. good code doesn't use them.

andy


[Prev in Thread] Current Thread [Next in Thread]