[ros-kernel] Re: C++

Martin Fuchs martin-fuchs at gmx.net
Thu Mar 11 08:57:21 CET 2004


> What's our policy on C++ code?

Another huge discussion about usage of C++ and its pros and contras started
by this little question. I will only reply to the original message.
To read another little article about "why C++" german readers could look
at my old home page: http://private.addcom.de/m.fuchs/prgsite/c++.html
But beware - it's not all really earnest what I wrote those days.  ;-)

Well, back to the main point:
You know I am a fan of C++ - nearly whole explorer is written using this
language. Sure I also don't say one should start writing the kernel in C++.
But if Andrew wants to try writing a sound card driver using it - why not?
Let him prove he is capable of handling the issues involved with this.

> Why would I want to do this? Well, because it makes life easier. I can
> create classes for instance-specific data that are automatically initialized
> to some default values, and then use linked list templates to hold them.

Andrew, I understand you want to use the STL list class?
I don't know much about kernel programming, but AFAIK one can't use
the standard libc allocation functions. Since STL uses by default malloc/free,
you would have to write your own allocator class using kernel memory
allocation functions, and plug this into your list classes.

Regards,

   Martin



More information about the Ros-kernel mailing list