阅读背景:

有没有办法强制实例只在堆栈上?

来源:互联网 

I have a C++ class for which I only ever want it to be instantiated on the stack. I am using an api to access content that was developed in another (interpreted) language which comes with its own garbage collection. The mechanisms in this language know enough to leave any content that it finds references to on the stack alone, and since this native class contains such a reference, it is of vital importance that for correct behavior, the user of the native C++ class it does not ever try to allocate an instance of it anywhere else.I have a C++ class for which I only ever want i




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: