Are raw C++ pointers first class objects?

后端 未结 5 771
小蘑菇
小蘑菇 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条回答
  •  萌比男神i
    2021-01-12 06:40

    From wiki:

    In computing, a first-class object (also value, entity, and citizen), in the context of a particular programming language, is an entity which can be passed as a parameter, returned from a subroutine, or assigned into a variable.1 In computer science the term reification is used when referring to the process (technique, mechanism) of making something a first-class object.[citation needed]

    I included the entire entry in wiki-pedia for context. According to this definition - an entity which can be passed as a parameter - the C++ pointer would be a first class object.

    Additional links supporting the argument: catalysoft wapedia

    reification: referring to the process (technique, mechanism) of making something a first-class object

提交回复
热议问题