utils::loading_cache: add the ability to work with not-copy-constructable values
utils::loading_cache: add the ability to work with not-copy-constructable values

Current get(...) interface restricts the cache to work only with copy-constructable
values (it returns future<Tp>).
To make it able to work with non-copyable value we need to introduce an interface that would
return something like a reference to the cached value (like regular containers do).

We can't return future<Tp&> since the caller would have to ensure somehow that the underlying
value is still alive. The much more safe and easy-to-use way would be to return a shared_ptr-like
pointer to that value.

"Luckily" to us we value we actually store in a cache is already wrapped into the lw_shared_ptr
and we may simply return an object that impersonates itself as a smart_pointer<Tp> value while
it keeps a "reference" to an object stored in the cache.

Signed-off-by: Vlad Zolotarov <976c0f8d0852ed6439ad273880b400a75a7c41d0@scylladb.com>

scylladb/scylla,duarten/scylla,scylladb/scylla,duarten/scylla,duarten/scylla,scylladb/scylla,avikivity/scylla,avikivity/scylla,scylladb/scylla,avikivity/scylla