C++ Deleting Static Data

后端 未结 5 1575
难免孤独
难免孤独 2021-02-12 11:47

If I have a class that contains private static data allocated on the heap that never changes, when, if at all, should I delete it?

As I understand it, a class itself is

5条回答
  •  后悔当初
    2021-02-12 12:03

    static data allocated on the heap means a member pointer that is static. If this is the case you can allocate memory to it.

提交回复
热议问题