I am trying to use delegating constructors in Visual Studio 2012. The following code compiles in Xcode 4.6 but not in Visual Studio 2012:
In the .h file
class ErrorReportDlg : public QDialog
{
public:
ErrorReportDlg(OwlExceptionPtr ex, QWidget *parent);
ErrorReportDlg(QWidget *parent);
virtual ~ErrorReportDlg();
}
In the .cpp file
// FWIW, OwlExceptionPtr is
// typdef boost::shared_ptr<OwlException> OwlExceptionPtr
ErrorReportDlg::ErrorReportDlg(OwlExceptionPtr ex, QWidget *parent)
: QDialog(parent),
_error(ex)
{
// stuff
}
ErrorReportDlg::ErrorReportDlg(QWidget *parent)
: ErrorReportDlg(OwlExceptionPtr(), parent) // <--- error here
{
// do nothing
}
The error I'm getting is:
error C2437: 'ErrorReportDlg' : already initialized
What am I doing wrong? Thank you!