[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++

From: Lluis
Subject: Re: C++
Date: Thu, 24 Sep 2009 20:59:47 +0200
User-agent: Mutt 1.5.20 (2009-06-14)

El Thu, Sep 24, 2009 at 02:00:31PM +0100, Sam Mason ens deleit� amb les 
seg�ents paraules:
> On Thu, Sep 24, 2009 at 01:49:48PM +0200, Arne Babenhauserheide wrote:
> > But then that isn't about C++ vs. C, it's about how to most efficiently 
> > represent your data in memory. And for many access patterns an array is 
> > simply 
> > the fastest way. 
> Yup, but if you're effectively ending up with C code what's the point in
> pretending it's C++.

Well, I doubt you'd use STL containers in kernel code, so this is kind of "out
of the scope".

Things like templatization abuse or default/"variadic" parameters might come in
handy to conjugate maintainability, readability and performance (given a decent

Or shorter function names and parameter list by means of object invocation, such
that you do not need to prefix the API functions with the abstraction name and
pass the object as first parameter. If you don't believe me, look at the glib
API :)

Besides, pure virtual functions should provide similar performance (if not the
very same, I haven't checked on the C++ specification) to system-wide tables of
function pointers (e.g., VFS in linux).

Read you,

 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom

reply via email to

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