
8 Nov
2011
8 Nov
'11
7:37 p.m.
Andrey Semashev wrote:
Reference counting? A library might return a smart pointer to a structure with a reference counter. Linking reference counting methods or making them virtual may be undesirable to allow inlining.
Yep. This is what I meant by "bad". Yes, shared_ptr does it, but it's still a bad idea. There is no reason to inline code that operates on atomics into several separate modules - it just creates the possibility of subtle ODR violations when the inlined code gets out of sync.