Does it make sense to provide non-const reference getter

前端 未结 9 895
滥情空心
滥情空心 2020-12-16 23:58

Sometimes I need to expose some of the class members. For example in the following example class Mechanic may need direct access to Engine componen

9条回答
  •  無奈伤痛
    2020-12-17 00:11

    I have found reasonable point to provide such getter. It makes integration of your software easier (for example, when you want to translate interface into another language and bind ABIs).

提交回复
热议问题