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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:08:13+00:00 2026-05-14T06:08:13+00:00

Suppose, I write class A { }; The compiler should provide (as and when

  • 0

Suppose, I write

class A { };

The compiler should provide (as and when needed)

  1. a constructor
  2. a destructor
  3. a copy constructor
  4. = operator

Is this all the compiler provides? Are there any additions or deletions to this list?

  • 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-14T06:08:13+00:00Added an answer on May 14, 2026 at 6:08 am

    It’s complete. But there are two points you should note:

    1. It’s the copy =operator. Just like there is a copy constructor, there is a copy assignment operator.
    2. They are only provided if actually used.

    Some explanation for 2:

    struct A { private: A(); };
    struct B : A { };
    

    That’s fine! Providing a default constructor would be ill-formed for “B”, because it would not be able to call the base-class’ constructor. But the default constructor (and the other special functions) is only provided (we say it’s implicitly defined) if it’s actually needed.

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

Sidebar

Related Questions

Suppose i have a function template StrCompare template<typename T=NonCaseSenCompare>//NonCaseSenCompare is a user defined class
Suppose I represent an image class as: template <typename Pixel> class Image { ...
I have a class which for now should always have a certain member populated
This is a follow up to my previous question . Consider that I write
Suppose I have a daemon that is sharing it's internal state to various applications
I seem to have faced this problem many times and I wanted to ask
All Points are Vectors, and all Vectors are Points. All Directions are Vectors, NOT
I've just started playing with T4, as I eventually want to use it to
It's not possible to inherit from a C# struct. It's not obvious to me

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.