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
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.
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
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.
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
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
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:
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++.
Specifically, I need to declare (as I understand it) intrusive_ptr_{add_ref,release} as friends of my referenced 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.