lkml.org 
[lkml]   [2000]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [Criticism] On the discussion about C++ modules
Date
From
"J . A . Magallon" <jamagallon@able.es> said:

[...]

> But there are some features of C++ that would be of great value for kernel
> development (in general for imperative programming), for example:

> - <const &> args : dont break your untouchable data, and get rid of
> pointer mess

It isn't _that_ bad. Besides, this "pointer mess" is ingrained in each C
programmer by now, to change that will get you hard to see bugs.

> - for (int i=0; ...) : don't use index outside loop

Rather trivial.

> And simple member functions are also fine, they impose NO call overhead
> and simplify the use of structs (hey, you can define structs with member
> funcs in C++, they dont have to be classes).

A struct in C++ is a class where the default visibility is public, nothing
else. And they _do_ impose an overhead via indirection to get the function
(they are essentially a function pinter in the struct) plus passing the
self pointer, which may need adjustment for bases and such. Trivial, but
could be important some places.

> So the base C++ is fine, its organized C. Esoteric features make the
> difference.

And are the stuff that makes C++ worthwile in the first place. I've written
very little C++, but being able to draw upon STL is mindboggling, but you
easily loose sight of what is going on behind the scenes.
--
Horst von Brand vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Vin~a del Mar, Chile +56 32 672616
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:41    [W:0.223 / U:0.288 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site