- To: coders@xxxxxxxxxxx
- Subject: Re: [coders] Well designed C++ API?
- From: Erik de Castro Lopo <mle+slug@xxxxxxxxxxxxx>
- Date: Thu, 12 Oct 2006 15:14:26 +1000
- Organization: Erik Conspiracy Secret Labs
- Reply-by: Fri Mar 4 18:43:51 EST 2000
Andre Pang wrote:
> Using smart pointers in C++ also makes memory management _much_
> easier,
I prefer smart design to the C++ template foo around smart pointers.
For instance, if a class can be designed to behave in an RAII way,
much pointer hackery can be localised and thereby made safe.
> and boost::shared_ptr is a very high quality implementation
> of a smart pointer that's available on a lot of platforms.
I realise that all this C++ template foo is very tricky, but
it *really* doesn't aid clarity. Code is written once and
read thousands of times. Template code often looks like line
noise to me.
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
The difference between genius and stupidity is that
genius has its limits.