Boost logo

Proto :

Subject: [proto] Hold terminals by "smart" reference
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2012-06-02 17:33:47


There are some terminals that, due to life-time issues, I cannot hold by
reference. I don't want, however, to hold them by value.

What I'm currently doing is that I'm holding a shared_ptr by value. For
all practical purposes, however, I'd prefer if the expression behaved as
a terminal of a reference, i.e. it would be nice if
boost::proto::value(xpr) could directly return a T& and not a
shared_ptr<T> const&.

Currently I need to treat terminals of shared_ptr specially, but ideally
I'd like to have a way to extend terminal value capture with custom
holding strategies.

Any way to do this?


Proto list run by eric at boostpro.com