www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22891] New: BetterC classes vtable

https://issues.dlang.org/show_bug.cgi?id=22891

          Issue ID: 22891
           Summary: BetterC classes vtable
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: msnmancini hotmail.com

I was talking with some people about the current state about betterC classes.
They said classes should work using both `emplace` and `scoped`. Some people
said that D can't support vtable for betterC classes right now because of its
ClassInfo. I don't really remember all the details, but it seems the problem is
that TypeInfo and ClassInfo aren't separated, which D some long time ago
actually separated for having .classInfo properties for classes. The decision
for that was for more performance and optimization opportunities. However, this
decision which was made much time before betterC was even thought made classes
unusable in betterC mode. As it is possible to do that without garbage
collection, I believe this is a fair enhancement, if at least separating the
class info again for the betterC switch, which would be able to bring a lot of
new opportunities.

--
Mar 17 2022