Boost logo

Proto :

Subject: Re: [proto] Hold terminals by "smart" reference
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2012-06-03 09:23:08

On 03/06/2012 02:59, Eric Niebler wrote:

> There is no way to hook proto::value to return anything but what is
> stored in the terminal. It's a very dumb, low-level function. You could
> easily define your own value function that does something smarter, tho.

I'm currently doing it with my own function, but that means I need to
use my own value instead of Proto's everywhere (value, result_of::value,
or _value).
Plus I don't have a good way to distinguish between a terminal of
shared_ptr<T> and a terminal of T which is held through a shared_ptr.

I was considering specializing something like expr<Tag,
term_shared<Arg>, 0> and basic_expr<Tag, term_shared<Arg>, 0> to do
this, but it appears I also need to change proto::value itself to call a
function instead of returning child0 directly.

Proto list run by eric at