I recently had an idea to wrap my DX11 resource pointers (ID3D11Buffer*, ID3D11RasterizerState*, etc...) so that Release would automatically be called once they are deleted from the vector that I use to save all created resources.
I then had the idea to check out STL to see if shared_ptr would provide the necessary functionality. So far it seems all I have to do is add a custom deleter function that calls Release().
I wanted to know if anyone has tried this approach before. If so, does it work as expected?
Thanks in advance.







