1

Do the parentheses after the type name make a difference with new?

How it's different in C++11?

And suppose we use initializer list, then how it's different?

TestWidget::TestWidget(): QWidget(parent)
, m_BoxWidget(new BoxWidget())
{
}

vs

TestWidget::TestWidget(): QWidget(parent)
, m_BoxWidget(new BoxWidget)
{
}

My BoxWidget class has constructor defined by me where I initialize the box's coordinates.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Sayan Bera
  • 135
  • 2
  • 16

0 Answers0