请教:地下室漏水 (转载)# Living
t*y
1 楼
Suppose you're responsible for writing class MyClass as part of a static
library.
a) How do you enforce that a single instance of this class be used at
compile-time? b) How do you enforce that instances only be allocated on the
stack, but not on the heap, at compile-time?
a)应该是用singleton
b)呢?
library.
a) How do you enforce that a single instance of this class be used at
compile-time? b) How do you enforce that instances only be allocated on the
stack, but not on the heap, at compile-time?
a)应该是用singleton
b)呢?