What is the member variables list after the colon in a constructor good for?

前端 未结 8 1038
予麋鹿
予麋鹿 2020-12-11 02:34

I\'m reading this C++ open source code and I came to a constructor but I don\'t get it ( basically because I don\'t know C++ :P )

I understand C and Java very well.

8条回答
  •  伪装坚强ぢ
    2020-12-11 03:02

    :: Actually means contains (see comments for clarification), however the _someMethods and so forth is what's called an initialisation list. There is plenty of info at the link =]

    EDIT: Sorry, my first sentence is incorrect - see the comments.

提交回复
热议问题