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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:40:33+00:00 2026-05-11T19:40:33+00:00

I have an abstract class with a couple pure virtual functions, and one of

  • 0

I have an abstract class with a couple pure virtual functions, and one of the classes I derive from it does not use one of the pure virtual functions:

class derivative: public base
{
public:
    int somevariable;
    void somefunction();
};

anyways, when I try to compile it, I get an error (apparently, a class is still considered abstract if derive from an abstract class and don’t override all pure virtual functions). Anyways, it seems pointless to define a function

int purevirtfunc(){return 0;}

just because it needs to be defined through a technicality. Is there anyway to derive a class from an abstract class and not use one of the abstract class’s pure virtual functions?

  • 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-11T19:40:33+00:00Added an answer on May 11, 2026 at 7:40 pm

    If your derived class doesn’t “use” the base class pure virtual function, then either the derived class should not be derived from the base, or the PVF should not be there. In either case, your design is at fault and needs to be re-thought.

    And no, there is no way of deleting a PVF.

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

Sidebar

Related Questions

I have an abstract class defining a pure virtual method in c++: class Base
I have a couple of pure virtual classes, Matrix and Vector . Throughout my
In C#, I have a class hierarchy with a couple of abstract base classes
Possible Duplicate: Pure virtual destructor in C++ I have two classes: the abstract Game
I have abstract class A, from which I inherit a number of classes. In
I have an abstract base class from which many classes are derived. I want
I have a abstract base C# class with a couple of methods that has
I have an abstract class and I would like to use it quickly by
I have an abstract class: type TInterfaceMethod = class abstract public destructor Destroy; virtual;
I have the following hierarchy of classes class classOne { virtual void abstractMethod() =

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.