Is it possible to create boost phoenix lazy variant of std::make_shared
? I mean, to make possible something like
namespace p = boost::phoenix;
...
expr = custom_parser[_a=p::make_shared<Node>(_1,_2,_3)] >> ...
One cannot use BOOST_PHOENIX_ADAPT_FUNCTION
because of variadic template nature of std::make_shared
. So, probably wrapper should be variadic template itself, if it is possible to write one.
Your
phx::make_shared
is very similar tophx::construct
. By changing slightlyconstruct
's header file you can get:Running on Coliru
If you can spare an extra set of parentheses:
Which you can uses like
See it Live on Coliru