b***m 发帖数: 58 | 1 Here is another one, don't quiet understand what it is asked.
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? |
T*******i 发帖数: 4992 | 2 你应该多看看精华区或者mark的文章,再去面试
not
【在 b***m 的大作中提到】 : Here is another one, don't quiet understand what it is asked. : 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?
|
b***m 发帖数: 58 | 3
精华区有吗,能给个链接吗? 谢谢
【在 T*******i 的大作中提到】 : 你应该多看看精华区或者mark的文章,再去面试 : : not
|
d***y 发帖数: 65 | 4 gg,还是自己去找找看吧~~
知道在哪里自己都懒得去找一下么?这应该自己去google简单点把?
【在 b***m 的大作中提到】 : : 精华区有吗,能给个链接吗? 谢谢
|
b***m 发帖数: 58 | 5
not
搜不到啊
【在 b***m 的大作中提到】 : Here is another one, don't quiet understand what it is asked. : 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?
|
p***o 发帖数: 1252 | 6 a) singleton
b) private operator new/delete
【在 b***m 的大作中提到】 : : not : 搜不到啊
|
b***m 发帖数: 58 | 7
Well, these are what I was thinking first. What I am not sure are how they
are related to "static library" and "enforce on compile time" mentioned in
the question
【在 p***o 的大作中提到】 : a) singleton : b) private operator new/delete
|
p***o 发帖数: 1252 | 8 Well, that means you don't really understand them.
Google and read those articles.
【在 b***m 的大作中提到】 : : Well, these are what I was thinking first. What I am not sure are how they : are related to "static library" and "enforce on compile time" mentioned in : the question
|