DragonFly kernel List (threaded) for 2009-01
Re: C++ in the kernel
On 2009-01-06 00:48, Simon 'corecode' Schubert wrote:
> Erik Wikström wrote:
>> On 2009-01-05 15:02, B. Estrade wrote:
>>> Is the current code bad or something? What exactly is the problem that
>>> can be "solved" with C++?
>> Actually I think the current code is quote good, at least the part's of
>> it that have been changed the last decade or so. And there is no problem
>> that can't be solved in C (or Fortran or Ada) that can't be solved in
>> C++. But fact is that many parts of the kernel uses object oriented
>> programming, but C does not have support for this at the language level
>> and C++ does. It is also a fact that current code uses macros to create
>> generic types (such as lists and queues) and once again this is
>> something that C++ has language level support for.
> I'd like to see a non-ugly template implementation that can be used like
> our current queue.h/tree.h macros. I don't like C++, but I'd be
> positively surprised it this could be solved elegantly.
I'm not familiar with the queue.h/tree.h macros and what purpose they
serve. A quick look tells me that queue.h gives some macros to create
intrusive lists and queues. Are they intrusive by choice or by
necessity, does the list own objects in it or are they owned by other