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 6893439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:39:31+00:00 2026-05-27T06:39:31+00:00

This question is more about language design and less about changing C++ conventions. While

  • 0

This question is more about language design and less about changing C++ conventions.

While thinking about the Go programming language (how it cleaning separates the data from the interfaces, effectively turning all objects into structs) and PODs in C++ (I like memset/memcpy when allocating a gazillion small struct-like objects), I was wondering about the C++ compiler convention of attaching a vptr directly to an instance of an object, messing up the layout.

Is this a requirement or just a convention?

If you were designing an alternative compiler, could you, instead, have a large external look-up table for vptrs? For example, a structure like map<void*,vptr>? All instances would be POD, with respect to memory setting, and to look up its vptr, we would take its address and look inside the large external lookup table.

The disadvantage is, everything would require a lookup. Is this a viable alternative design or are there serious drawbacks?

  • 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-27T06:39:33+00:00Added an answer on May 27, 2026 at 6:39 am

    Performance will very probably suffer. Some languages add some kind of caching for method lookup.

    You could have a different way of finding the method to call for a given selector (or method name). Look at Smalltalk or Self or Javascript or Common Lisp Object system or Ocaml

    However, some languages implementation contains clever tricks (caching, JIT, …) making them as fast as C++ (but it is an implementation issue, not a language design issue).

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

Sidebar

Related Questions

This question is more or less programming language agnostic. However as I'm mostly into
EDIT: This question is more about language engineering than C++ itself. I used C++
This is kind of more generic question, isn't language-specific. More about idea and algorithm
This isn't really a programming question but more about programming and testing tools. Is
This question is more UI/Design-ish than hard-core programming is. Background: I've been coding in
This is a question not really about programming (is not specific to any language
So I'm trying to learn more about lambda expressions. I read this question on
I got this in an interview question -- the question was more about what
More than about LINQ to [insert your favorite provider here], this question is about
I know there is already a question about this but my issue is more

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.