Boost logo

Boost :

Subject: Re: [boost] [ValueRef] Interest in a new library for immutable values with internal sharing?
From: Thomas Jordan (tomjordan766_at_[hidden])
Date: 2015-04-20 13:07:08


> Message: 2
> Date: Mon, 20 Apr 2015 15:40:37 +0100
> From: Sam Kellett<samkellett_at_[hidden]>
>
> To:boost_at_[hidden]
> Subject: Re: [boost] [ValueRef] Interest in a new library for
> immutable values with internal sharing?
> Message-ID:
> <CAHK+-Fsy1-sCuMuz+hpjNC2ogAbxUazNY0Qt3xL__bndzkwduw_at_[hidden]>
> Content-Type: text/plain; charset=UTF-8

> I had a similar idea for a new smart pointer that would aim to obsolete the
> shared_ptr-to-const idiom. The problem I found with that idiom is that it
> only guarantees that you can't change it. There's no promise that somebody
> else doesn't have a non-const ref to the data and so it could in the worst
> case completely change from under your feet (even if you know it won't get
> destroyed).

ValueRef doesn't expose (shared) pointers/pointees, they are a hidden, implementation detail. Its interface just deals in values (as shown in the example usage).


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk