在boost spirit中是否有更好的转换为大写的方法?

在boost spirit中是否有更好的转换为大写的方法?,boost,boost-spirit,boost-phoenix,Boost,Boost Spirit,Boost Phoenix,我为phoenix::function struct to_upper_impl { template <typename T1> struct result { typedef std::string type; }; std::string operator()(const std::string & s) const { return boost::algorithm::to_upper_copy(s); } }; boost::phoe

我为
phoenix::function

struct to_upper_impl
{
  template <typename T1>
  struct result { typedef std::string type; };

  std::string operator()(const std::string & s) const
  {
    return boost::algorithm::to_upper_copy(s);
  }
};

boost::phoenix::function<to_upper_impl> to_upper;
struct to\u upper\u impl
{
模板
结构结果{typedef std::string type;};
std::string运算符()(常量std::string&s)常量
{
将boost::algorithm::返回上拷贝;
}
};
boost::phoenix::函数到_upper;
然后在我的语义动作中使用这个函数

我想知道我是否可以在我的语义代码中使用某种单行程序来代替(创建结构)


谢谢

据我所知-没有。到目前为止,没有其他方法可以将其他可调用类型作为参数传递给phoenix::function。当我尝试使用它时,我尝试使用C++11 lambdas,但由于Boost.ResultOf协议,尝试调用带有一些参数的phoenix::function时失败了。您可以在此线程中看到解释: 使用boost(BLL)和phoenix lambdas并不会更短、更轻。因此,到目前为止,没有好的选择