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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:37:37+00:00 2026-05-25T11:37:37+00:00

When inheriting from a class, you know the requirements and restrictions imposed on you

  • 0

When inheriting from a class, you know the requirements and restrictions imposed on you by simply looking up the hierarchy. For example, you can find out just by looking at the parent class(es) which methods are required to be defined (pure virtual). If one chooses to use templates instead (if it fits the bill) then things are not as clear. The methods of the template class may be expecting several methods for the type to be present.

I ran across a complex class that I have to use. I did not know what methods my type (class/object) was supposed to have. The only way I could find out was by compiling where the compiler would let me know which methods were expected. It’s like inheriting from an abstract class without access to the header file. This is a bit of a pain as it is time consuming to figure out the method specifications (signature).

Now the original designer of the class could have put some documentation as to which methods are expected to be present and their signatures, but I can’t help but wonder if there is a way the code can be self documented (or is already and I don’t know how to view it?). Compiling and looking at the errors can’t be the only way, can it?

  • 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-25T11:37:37+00:00Added an answer on May 25, 2026 at 11:37 am

    You’re essentially describing the kind of problem that C++0x concepts was going to solve by providing programmers a way to enforce requirements on type at compile time. However, it was removed in July 2009 due to time constraints.

    There is a library-only solution in Boost called the Concept Check Library (BCCL). However, there are differences between the BCCL and what C++0x concepts was going to be. It’s the closest thing to concepts we have for the current language.

    If you much rather not have to use the BCCL, then documentation is the next best thing.

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

Sidebar

Related Questions

I want to know if one class is inheriting from another, is it better
I have a simple class inheriting from WebControl as follow: public class Instrument :
I have all my views in a project inheriting from a ViewBase class that
Is the route table available from the filters? I'm inheriting from the AuthorizeAtrribute class.
Consider this - a base class A, class B inheriting from A, class C
What I have? I have an abstract class QueryExecutor and many classes inheriting from
inheriting a class attribute from a super class and later changing the value for
Say we have a class inheriting from two base classes (multiple inheritance). Base class
Utilizing .Net I am inheriting from an older class that has DateTime and bool
So I have a base class Animal which has 2 classes inheriting from it,

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.