On 6/3/2012 6:23 AM, Mathias Gaunard wrote: > 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).
Right. > 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. Have you tried a grammar? Something like (untested) proto::terminal< boost::shared_ptr< proto::_ > > ? > 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. In my opinion, defining your own value function would be a much easier, cleaner solution. -- Eric Niebler BoostPro Computing http://www.boostpro.com _______________________________________________ proto mailing list proto@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/proto