b***k 发帖数: 2673 | 1 ☆─────────────────────────────────────☆
bbram (bob) 于 (Sat May 3 13:39:31 2008) 提到:
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?
此题是问singleton 的implementation 吗?
☆─────────────────────────────────────☆
binrose (BigHead) 于 (Sat May 3 17:11:15 2008) 提到:
Yes it i |
|