lkml.org 
[lkml]   [2024]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 00/45] C++: Convert the kernel to C++
From
On 1/9/24 15:40, David Howells wrote:
>
>> Both C and C++ has had a lot of development since 1999, and C++ has in fact,
>> in my personal opinion, finally "grown up" to be a better C for the kind of
>> embedded programming that an OS kernel epitomizes.
>
> And gcc got rewritten in C++ some time back, so they have a vested interest.
>

Indeed.

>>> (8) 'virtual'. Don't want virtual base classes, though virtual function
>>> tables might make operations tables more efficient.
>>
>> Operations tables *are* virtual classes. virtual base classes make sense in a
>> lot of cases, and we de facto use them already.
>
> You end up adding storage for a 'this' pointer for each virtual base class, I
> think - and then you may have extra fun if you inherit from two classes that
> both inherit the same virtual base class. Abstract base classes that are just
> ops tables are probably fine, though.

My apologies, I meant *abstract* base classes, not *virtual*. To be
honest, I don't think I have ever used virtual base classes in any other
application than games (relating to physical objects), and barely even then.

-hpa

\
 
 \ /
  Last update: 2024-01-12 03:25    [W:0.792 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site