r***@gmail.com
2006-03-06 04:35:42 UTC
Here is the problem. There are two constructors of the same class
~~~~~~~~~~~~
CClass()
: param1 (0.5),
param2 (100000),
param3 (NULL),
szPath (NULL)
{
}
CClass(char *path)
: szPath(path)
{
}
//Assume we have the following object
CClass cc_path(szSomePath);
~~~~~~~~~~~~
Is it possible to call CClass() initialization list, before call to
CClass(char *path)? Well an obvious workaround is to create some
private member function that will contain all instantiations but is it
possible to do something leaving everything intact and just adding some
code?
~~~~~~~~~~~~
CClass()
: param1 (0.5),
param2 (100000),
param3 (NULL),
szPath (NULL)
{
}
CClass(char *path)
: szPath(path)
{
}
//Assume we have the following object
CClass cc_path(szSomePath);
~~~~~~~~~~~~
Is it possible to call CClass() initialization list, before call to
CClass(char *path)? Well an obvious workaround is to create some
private member function that will contain all instantiations but is it
possible to do something leaving everything intact and just adding some
code?