
(1) Why stock implementation of intrusive counter is not included to Smart Pointers library ?
No idea. This was requested recently on the devel list, but didn't receive an answer. http://lists.boost.org/Archives/boost/2008/06/139048.php
Thank you. Although the code in that message is more like a pseudocode than an actual implementation, inline non-template friends seems better than templates in my code.
(2) Is there something wrong with my code ?
It will only compile on windows...
long operator++(void) { return ::InterlockedIncrement(&count_); } long operator--(void) { return ::InterlockedDecrement(&count_);
I don't think it's a big problem. If I need to compile on anything else, I'll see the error and use the atomic functions corresponding to those of windows.