More C++ Idioms/Thread-safe Copy-on-write

= Thread-safe Copy-on-write =

Intent
Allow objects to be quickly accessed in a concurrent safe manner without necessary copying, preferably without locks.

Motivation
Many applications allow for configuration changes in runtime but concurrently applying changes to the system requires fast synchronization primitives. Ubiquitous mutual exclusion that might block the executing thread is not a viable solution for latency sensitive applications like game engines. This idiom is an alternative to popular mutual exclusion in situation where reads are common and writes are rare. The reading path is fast and never blocks but incremental writes might require mutual exclusion.

Details
This implementation relies on a fact that library folly provides lock free atomic shared pointer. Not all libraries provide lock free smart pointer, even if atomic specialization is available. Namely c++ standard library does not provide lock free atomic pointers. Following code would not evaluate to true.