I am learning C++ in Qt environment and I was going through one of the sample code online. Can anyone please explain this syntax to me?
const TicTacToe * GetTicTacToe() const { return m_tictactoe.get(); }
Why is there a const
before the opening bracket of a function? Is it a pointer or multiplication?
the full class is as follows, but the syntax of the instructions mentioned above is not clear to me
class QtTicTacToeWidget : public QWidget
{
Q_OBJECT
public:
explicit QtTicTacToeWidget(QWidget *parent = 0);
const TicTacToe * GetTicTacToe() const { return m_tictactoe.get(); }
void Restart();