POV-Ray : Newsgroups : povray.off-topic : Lots of statistics : Re: C# Server Time
29 Jul 2024 16:25:11 EDT (-0400)
  Re: C#  
From: Warp
Date: 14 Aug 2012 13:31:09
Message: <502a8b5d@news.povray.org>
Le_Forgeron <lef### [at] freefr> wrote:
> Tetracapilli... if you compile with RTTI (default for most, including
> gnu), an instance of an empty class is already the size of a pointer: to
> the class description.

I don't know how to explain this more clearly than I have already done.

If a class has no virtual functions, it will have no vtable pointer.
RTTI has nothing to do with this.

If you have, for example, one int as its member, the size of the class
will be typically 4 bytes.

Now add a virtual function to the class: Suddenly its size is 8 bytes
(16 if compiling a 64-bit binary). The size of the class has doubled
(quadrupled in 64-bit systems).

This is the reason why vtables are added only to classes that have virtual
functions.

> In Embedded C++, there is no multiple inheritance, no C++ cast (neither
> down or up), no mutable attribut, no namespace, no exception, no
> templates and no stdio.

That sounds like a pretty useless C++.

(Why no namespaces or templates? What do those have anything to do with
embedded systems?)

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.