Boost logo

Boost Users :

Subject: [Boost-users] [phoenix] function with reference implementation
From: alfC (alfredo.correa_at_[hidden])
Date: 2010-09-10 16:37:28


I noticed that in some contexts I have both the object class and the
corresponding phoenix function

  class impl;
  ...

  impl f_impl;
  boost::phoenix::function<impl> f(f_impl);

now to avoid the copying I could use:

  boost::phoenix::function<impl&> f(f_impl);

which works. Although
  boost::phoenix::function<impl const&> f(f_impl); //doesn't work.
(error below)

Is there any problem with using references at all, in the first place?
-- Thanks, Alfredo

/home/correaa/usr/include/boost/spirit/home/phoenix/function/
function.hpp:31: error: conversion from
‘boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::detail::function_eval<1>,
boost::fusion::vector<boost::phoenix::value<gsl::interpolation::spline>,
boost::phoenix::argument<0>, > > >’ to non-scalar type
‘boost::phoenix::actor<boost::phoenix::composite<boost::phoenix::detail::function_eval<1>,
boost::fusion::vector<boost::phoenix::value<const
gsl::interpolation::spline>, boost::phoenix::argument<0> > > >’
requested


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net