smart-pointers
deep copy of object which hold references to other objects
I have a \"sum\" class which holds two references to existing ints (say). I want to create a \"copy\" method which deep copies the ints. I thought I would never have to manually delete objects in my c[详细]
2023-04-13 09:46 分类:问答Smart pointers in C++ with shared object-validation
I need smart pointer class or template, which can invalidate it\'s referencing object after \'delete\' happens. Key point is to make pointer usable in debug for multy-thread apps.[详细]
2023-04-13 03:49 分类:问答How does it convert _bstr_t to BSTR when passing as an argument?
Taking a simple example: _bstr_t smartString(L\"MyString\"); Process(smartString); // takes BSTR. Initially I thought _bstr_t has a BSTR operator conve开发者_运维百科rting from _bstr_t to BSTR, bu[详细]
2023-04-09 22:47 分类:问答Can Google Mock a method with a smart pointer return type?
I have a factory that returns a smart pointer. Regardless of what smart pointer I use, I can\'t get Google Mock to mock the factory method.[详细]
2023-04-09 11:47 分类:问答Heap corruption
I don\'t even know where to start... Visual Studio keeps giving me a heap corruption error when I close my program. The position it breaks at varies. During the 40+ hours I have spent changing my code[详细]
2023-04-04 04:17 分类:问答Need to Release a com_ptr_t before reassigning with CreateInstance?
In a C++ class with _com_ptr_t members, will memory leak if CreateInstance() is repeatedly used on the same pointer to get fresh instances of COM objects, without first performing a Release()?It\'s we[详细]
2023-04-02 05:27 分类:问答Using boost::bind to create a function object binding a auto-release "heap" resource
I try to use boost::bind to create a function object, as well, I want to bind a object created on the HEAP to it for a delay call. The example code like below:[详细]
2023-04-01 10:16 分类:问答C++ Smart pointer own implementation
Let\'s say that you\'re on a system where you cant use TR1, boost, etc.You just have the straight-up standard library C++.[详细]
2023-03-31 07:52 分类:问答Using boost::intrusive_ptr with a nested classes
Specifically, I need to declare (as I understand it) intrusive_ptr_{add_ref,release} as friends of my referenced class:[详细]
2023-03-28 21:25 分类:问答Cannot assign int to member int of returned class
Not 100% sure whether my question is worded correctly as I don\'t fully understand my problem. For my course I need to create my own smart pointer to clean up after itself.[详细]
2023-03-28 21:04 分类:问答