473,809 Members | 2,687 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Syntax of constructors of inherited classes calling the original constructor

I have to work on a rather big project that a bunch of people wrote and
that has no useful documentation at all, my C++ has rusted in a bit,
now I stumbled over a constructor that looks something like the below
and have no idea what to do with it :)

inheritedClass: :inheritedClass ([...bunch of arguments...])
: originalConstru ctor ([...bunch of arguments...])
, m_cells(cells), m_srfcs(srfcs)
{
[... some code ...]
}

Now my problem is that I have no clue what the comma-separated
arguments(?) m_cells and m_srfcs do in this method definition. Is
anyone able to enlighten me what this syntax is good for?

Besides not knowing what those arguments do, I must know wether this
usage of the two class instances (m_cells and m_srfcs are instances of
2 classes) would call their constructor, because in that case I would
need to modify the argument passed to them.

I would simply test this, but the project is just too big and there are
too many changes that I have to do at once before I can do a test
compilation and check it's runtime behaviour.

Any help is appreciated :)

Regards,

Lars Uffmann

Dec 1 '05
20 3235
Howard wrote:
"Gabriel" <ab***@127.0.0. 1> wrote
You can use this idiom to make the copy constructor inaccesible:
class Blob{
private: Blob& Blob(const Blob&);
// other stuff
};


Constructors don't have a return value. For "Blob", the copy constructor
would be:

Blob( const Blob& );

Perhaps you're confusing that with the assignment operator?

-Howard


Yes, I was. Looked too long as I wrote it, but I just couldn't see it.
Thanx.

--
Who is General Failure and why is he reading my hard disk?
Dec 1 '05 #21

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

42
5816
by: Edward Diener | last post by:
Coming from the C++ world I can not understand the reason why copy constructors are not used in the .NET framework. A copy constructor creates an object from a copy of another object of the same kind. It sounds simple but evidently .NET has difficulty with this concept for some reason. I do understand that .NET objects are created on the GC heap but that doesn't mean that they couldn't be copied from another object of the same kind when...
3
1772
by: SLE | last post by:
Hi there, I know constructors are not inherited from the base class, not in VB.NET nor C# (nor Java I suppose). I never wondered,but reflecting on the reason why, I cannot find a solid answer. Is the reason technical (compiler or CLR limitation) or logical (OOP best practices)? Any feedback would be greatly appreciated.
6
318
by: Doug | last post by:
I have a public abstract class that I want to inherit from in two other classes. My public abstract one has a constructor with several parameters. For some reason I cannot get to that constructor unless I create a constructor in my two other classes like this: public ClassName(string szParameter1, string szParameter2, string szParameter3) : base(szParameter1, szParameter2, szParameter3) { }
3
1434
by: Alexander Muylaert | last post by:
Hi Is their a way to keep constructors visible in inherited classes? public class X{ public x(int A){} } public class Y : X{};
21
2055
by: Michael Hull | last post by:
Hi, I remember from somewhere reading that inlining constructors is a 'BadThing', but now can't seem to find the original source. I can't however thing of a reason why it would be for simple constructors... any thoughts Mike
0
10639
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10383
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.