Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

Private inheritance causing problem in c++

There's nothing wrong with your logic, except that it's missing one point:

private inheritance basically means that only the inheriting class (B in this case) knows that it inherits from the base A. That in turn means that only B can make use of all the privileges that come with this inheritance. One of these privileges is to be able to cast B* to A*. The function foo() doesn't know about B's inheritance, so it cannot perform that cast.

Tags:

C++

Related

Is casting to simd-type undefined behaviour in C++? Storybook w/ react-router - You should not use <Link> outside <Router> Prevent function taking const std::string& from accepting 0 Is there a way to concatenate grouped lists into a set in Java 8 in one line? How to get default compile-time value of Auto-Implemented property C# 6.0 after it changed? VS Code: Python Interpreter can't find my venv Why doesn't this function terminate in Haskell? Unable to find any GraphQL type definitions for the following pointers: src/**/*.graphql java.lang.RuntimeException: Duplicate class org.intellij.lang.annotations.Flow found in modules annotations-16.0.1.jar and annotations-java5-15.0.jar How ViewModel survives configuration change Is there a way for two People to work on one Jupyter Notebook Xcode Error Report Xcode quit unexpectedly

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy