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

  • Home
  • SEARCH
  • 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 3219230
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:37:16+00:00 2026-05-17T15:37:16+00:00

what exactly does it mean from technical point of view , I understood that

  • 0

what exactly does it mean from technical point of view, I understood that it means that my derived class can always be converted to base class, that’s it? I read some materials without any reference to technical aspects, only philosophy! thanks in advance

  • 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-17T15:37:16+00:00Added an answer on May 17, 2026 at 3:37 pm

    it means that my derived class can always be converted to base class

    Actually it means better than that. int can always be converted to float, but that doesn’t mean an int “is a” float. It just means a float can be constructed from an int. Likewise you can have user-defined classes that convert, but have no other relationship.

    With inheritance, a pointer or reference to the derived class can always be converted to a pointer or reference to the base class[*]. That is to say, an object of the derived class can stand in place of an object of the base class. It actually is one of those things. If a person can stand in for a brain surgeon, then they’re a brain surgeon.

    One formal definition if “is a” is Barbara Liskov’s substitution principle. Which admittedly is still philosophy, but it’s very sound philosophy and it relates directly to how you write programs.

    The other thing you have to keep straight when using inheritance in C++ is the difference between runtime polymorphism (achieved using virtual functions) and static polymorphism (which doesn’t actually require inheritance at all). With non-virtual function calls, the version of the function called is always the version defined in the class that the compiler is told the object has (the static type). This might not actually work correctly, if it’s overloaded in the derived class. With virtual calls, the version called is the version defined in the class the object actually is (the dynamic type). It’s essential to decide which of the two kinds of “is a” you’re aiming for.

    [*] and the object be validly accessible through the pointer, that is. You can always coerce pointer types with reinterpret_cast, but that’s not what I mean here. And there are some fiddly details – if the base class is ambiguous then you can’t convert the pointer in one go, but you can do it explicitly using several unambiguous casts. If the base class is not accessible then you can convert it, but only with a C-style cast, not implicitly. The C-style cast acts like a static_cast which ignores accessibility, not like a reinterpret_class. So you get a working pointer, but hopefully also a strong sense that you’re doing something very wrong 😉

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

Sidebar

Related Questions

What exactly does immutable mean - that is, what are the consequences of an
What exactly does the word patch mean when referring to 'submitting a patch'? I've
What does this mean exactly? I'm doing something like this: File.Copy(@\\foo\bar\baz.txt, @c:\test\baz.txt); MSDN doesn't
Can anyone tell me what exactly does this Java code do? SecureRandom random =
Writing a JSP page, what exactly does the <c:out> do? I've noticed that the
Exactly that: Does a strings length equal the byte size? Does it matter on
What exactly does null do performance and storage (space) wise in MySQL? For example:
How exactly does NSInvocation work? Is there a good introduction? I’m specifically having issues
What is the difference between == and === ? How exactly does the loosely
I've seen the @ symbol used in PowerShell to initialise arrays. What exactly does

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.