Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Neil Cerutti Newsgroups: comp.lang.python Subject: Re: [OT] Quick intro to C++ for a Python and C user? Date: 21 Dec 2011 14:04:54 GMT Organization: Norwich University Lines: 22 Message-ID: <9le7c5F1lsU1@mid.individual.net> References: <9lc2u5FilrU1@mid.individual.net> <7xr4zzx8k9.fsf@ruckus.brouhaha.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: individual.net Wnor6ibLyg/0ukgdTPY7mQPBQcnGdY/dlaeiD7qnq6+iHyYO94 Cancel-Lock: sha1:QxZHAZm/tku1jtzGyKkQ1Aprcbs= User-Agent: slrn/0.9.9p1/mm/ao (Win32) Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:17664 On 2011-12-20, Paul Rubin wrote: > Grant Edwards writes: >> Oops. I should have mentioned this is for embedded systems >> programming so templates in general (and STL in particular) >> are probably off the table. > > Templates are how C++ does generics and I'd expect them to > appear in be used in embedded programming as well as elsewhere. > They can bloat up the code if you're not careful (if function f > has several parameters, you can end up with a separate, > specialized copy of f for every combination of types that f is > called with in the program), but in the typical monomorphic > situation they don't add any overhead. I'm not sure about the > situation with STL. Anyway, templates aren't terribly hard to > understand. Moreover, if you don't plan to take advantage of templates or inheritance, then you could as well write C++ compatible C and be pretty happy with the results. -- Neil Cerutti