Are raw C++ pointers first class objects?

后端 未结 5 773
小蘑菇
小蘑菇 2021-01-12 06:15

According to Wikipedia:

An object is first-class when it:

  • can be stored in variables and data structures
  • can be passed as a parameter to a sub
5条回答
  •  情歌与酒
    2021-01-12 06:26

    The Wikipedia article is shit (for once I agree with "citation needed"), but you are not missing anything: according to the Wikipedia definition, and also according to any sane definition, raw C++ pointers are first-class objects.

    If anyone would like to volunteer to help me with some searches through Google Scholar, I would really like to see that Wikipedia article fixed. I am a subject-matter expert, but I am also extremely busy—I would love to have a partner to work on this with.

提交回复
热议问题