Well, the syntax for this makes little sense, as your calling an implicit constructor for the base with its typename, as appose to an actual identifier of an object......just look at this example:
The parent has values a,b and c.
The child inherits, and adds values d.e and f.
The parent has a constructor for (a,b,c).
The child has a constructor for values (a,b,c,d,e,f).
#include<iostream>
class parent{
public:
parent
(
const int ia,
const int ib,
const int ic
):
a(ia),
b(ib),
c(ic)
{
}
int a,b,c;
};
class child: public parent {
public:
child
(
const int ia,
const int ib,
const int ic,
const int id,
const int ie,
const int If
):
parent(ia,ib,ic),
d(id),
e(ie),
f(If)
{
}
void out()const
{
using std::cout;
cout
<<a<<' '
<<b<<' '
<<c<<' '
<<d<<' '
<<e<<' '
<<f<<' ';
}
int d,e,f;
};
int main()
{
child c(0,1,2,3,4,5); //Ok, so here we want to
c.out(); //this will print out a,b,c,d,e then f's values
std::cout<<std::endl<<"Press return to continue"<<std::endl;
std::cin.get();
return 0;
}
In the childs constructor, we could have went a=ia, b=ib, but your prblem was that you wanted to involve an implicit initialisation so that you could pass arguments to the constructor of the class your inheriting off of (ie wxDialog).
Well, as you can see from the above example, the implicit allocation uses the name of the type your inheriting off of, even though its not a variable...So it doesnt make too much sense, but its usefull. (parent)(*this)(a,b,c) would make more and less sense, less because *this doesnt exist yet.