3 ms·
I would rather use the non-atomic shared pointer from Boost[1] linked upthread than a non-standard non-portable implementation detail from GCC, but yes, it exis
by dureuill 3y ago
I would rather use the non-atomic shared pointer from Boost[1] linked upthread than a non-standard non-portable implementation detail from GCC, but yes, it exists.
You can definitely implement a non-atomic non-threadsafe shared pointer in C++, my point in the article is that actually using it is very error prone. This is supported by the type being excluded from the standard library with one of the reasons being the risk of bugs.
[1]: https://www.boost.org/doc/libs/1_65_0/libs/smart_ptr/doc/html/smart_ptr.html#local_shared_ptr https://www.boost.org/doc/libs/1_65_0/libs/smart_ptr/doc/htm...
- PaulDavisThe1st 3y agoThe extent of the error prone-ness depends entirely on what "send to another thread" means (i.e. precisely how this is done).