Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 541055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:18:15+00:00 2026-05-13T10:18:15+00:00

Why, for example, is there no language support to examine a vtable? Why can’t

  • 0

Why, for example, is there no language support to examine a vtable? Why can’t I replace a member function with a new one? I have a gut feeling that there are ways to put such features to good use.

Are there any other languages out there which allow me to do such things?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:18:15+00:00Added an answer on May 13, 2026 at 10:18 am

    The main reason is that keeping vtable as an implementation detail allows any concrete implementation to optimize it as it sees fit; this means that it can e.g. trim or even eliminate vtable altogether if it can prove that there are no virtual calls for a given method (or all methods). Or it may replace a vtable dispatch with an if-else type check if e.g. it sees that there are only a few alternatives (this can be advantageous because branch prediction will work in this case, but not with vtables, and also because if-else branches can then be inlined). It can reorder methods in vtable such that most commonly called ones come earlier, or such that those that are commonly called one right after another fill adjacent slots in vtable to take advantage of caching. And so on, and so forth. Of course, all those implementations would also make vtable layout entirely unpredictable, and thus useless, if it were to be exposed (by the language spec) to implementation.

    As well, vtables aren’t as simple as they sound to be. For example, compilers often have to generate thunks to fix-up this pointer for things such virtual inheritance, or multiple inheritance combined with covariant return types. This is again something that doesn’t have a “single best way” to do it (which is why different compilers do it differently), and standardizing it would effectively require settling on a particular way.

    That said, “vtable switching” is a potentially useful technique if exposed as a higher-level construct (so that optimizations are still possible). For an example, see UnrealScript, which allows one to define several states for a class (one default, other named), and override some methods in named states. Derived classes can override more methods in existing states, or add their own states and override in them. Furthermore, states can extend other states (so if a method isn’t overridden for a particular state, it falls back to the “parent” state, and so on until the chain reaches the default state). For actor modelling (which games essentially are) this all makes a lot of sense, which is why UnrealScript has it. And the obvious efficient implementation mechanism for all of this is vtable switching, with each state having a separate vtable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 531k
  • Answers 531k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you have net-snmp installed, and you can execute programs… May 16, 2026 at 11:52 pm
  • Editorial Team
    Editorial Team added an answer Try transpose followed by flip. The flip is needed because… May 16, 2026 at 11:52 pm
  • Editorial Team
    Editorial Team added an answer Use the -o option to control what data is output… May 16, 2026 at 11:52 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Hello I need to have multiple language support of my django admin application.I can
In my applicaion which is going to support language other than English, is there
Is there a tool that calculates various LOC statistics? It would have to support
Are there any python packages that help generating SQL queries from variables and classes?
There are many, many, many options out there, but I still couldn't settle with
Imagine I have a class used to represent some trivial numerical data, like a
I was wondering why smartphone/mobile device OSs are not written to allow dynamic languages
C# has the using statement, specifically for IDisposable objects. Presumably, any object specified in
I am working on an application in Delphi 2009 which makes heavy use of
I've seen lots of examples of making an entire regular expression case-insensitive. What I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.