Message: 11 Date: Mon, 20 Apr 2015 13:22:35 +0300 From: Andrey Semashev
To: boost@lists.boost.org Subject: Re: [boost] [ValueRef] Interest in a new library for immutable values with internal sharing? Message-ID: <1988978.ROPBOsQPor@lastique-pc> Content-Type: text/plain; charset="us-ascii"
On Monday 20 April 2015 11:04:22 THOMAS JORDAN wrote:
Hi, I'd like to gauge whether there might be any interest in a new Boost library comprising a generic, non-intrusive, wrapper class for creating immutable/const values with sharing of the underlying object via internal reference counting.
Is this similar to Boost.Flyweight?
It is similar in that both provide a 'smart' handle which can be used
pretty much as a drop in for the wrapped type.
However, Boost.Flyweight requires the wrapped type to be hashable. Also,
there is a level of indirection with Flyweight which can mean that
unnecessary temps may need to be created to do the initial lookup (and
addition) to the Flyweight store, unless you use the Flyweight key-map
interface. ValueRef does not use 'flyweighting.' That is, if there are two
ValueRefs created independently with the same value, e.g.,
ValueRef