Warning about hiding member variables?

后端 未结 3 1150
一向
一向 2020-12-11 04:17

The following code snippet has a memory leak that I spent too much time chasing down. The problem is that inside Foo(), the local variable x_ hides the member variable x_.

3条回答
  •  攒了一身酷
    2020-12-11 04:42

    We use these warts on the beginnings of names - a_ argument d_ data member s_ static data in class f_ static data in file

    ... and no wart for local variables.

    Truly, the Lakos book is your friend.

提交回复
热议问题