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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:09:29+00:00 2026-05-27T08:09:29+00:00

for example, your constructor might look like this: myClass::myClass(Mesh &mesh) : baseClass(mesh) { pointer

  • 0

for example, your constructor might look like this:

myClass::myClass(Mesh &mesh) : baseClass(mesh) 
{
    pointer = new Thing(mesh);
}

mesh is not held in myClass, nor is there a getter for mesh in baseClass where it is held. Is this simply a case of having to implement a getter in the base class?

for example you cannot do this:

myClass::myClass(const myClass& original) : baseClass(mesh) //there is no mesh
{
    pointer = new Thing(mesh); //mesh is no longer in the parameter list
} 

How does the compiler make this copy when it creates a default copy constructor for such classes? Or is this a case where a copy constructor is necessary? mesh is not a private member of brain, and there is not getter for it so how do we make a new Thing?

EDIT – Updated the problem by adding Thing

  • 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-27T08:09:29+00:00Added an answer on May 27, 2026 at 8:09 am

    mesh has to be copied inside the baseClass copy constructor.

    class baseClass
    {
      Mesh myMesh;
    public:
      baseClass(const baseClass &other) : myMesh(other.myMesh) {} // <--- copy Mesh
    };
    
    class myClass : public baseClass
    {
    public:
      myClass(const myClass& other) : baseClass(other) {} // <--- simply pass
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example, your application is using this way for passing vars into your application
I have seen examples containing things like this: mountSharedResource(/images/logo.gif, new ResourceReference(ImageScope.class, logo.gif).getSharedResourceKey()); mountSharedResource(/resource, Application.class.getName()
I need your help, For example I have a decimal type variable and I
For example, is it possible to set the Output path to your app folder
Think about the following: Your ISP offers you a dynamic ip-address (for example 123.123.123.123).
How do you manage your project life cycle? For example: Do you start with
Is it possible to implement autoboxing for your own classes? To illustrate my example,
WPF is great because there are many ways to achieve your goals. For example,
Certain collection types in .Net have an optional Initial Capacity constructor parameter. For example:
I have the following inline Javascript code: <a href=javascript:{ document['example'].src = 'cube.png'; document.getElementById('constructor').innerHTML =

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.