I am trying to write an exception class convinient to use with a constructor behaved like printf, example:
class ExcBase
{
ExcBase(const char *fmt, ...)
{
// call things like vsprintf
}
};
but inheritance of construct does not seem available in c++, so I want write a inherited class like:
class ExcChild : public ExcBase
{
ExcChild(const char *fmt, ...)
: ExcBase(fmt, ...) // XXX: how to pass the trailing parameters to the constructor?
{
}
};
or I will have to write the same constructor for all the child classes, and that was too annoying...
this question troubles me a lot, and I can not figure out a way to solve this... any information will be a great help...