加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

是否有更好的方式转换为提升精神的大写?

发布时间:2020-12-16 06:59:17 所属栏目:百科 来源:网络整理
导读:我做了一些为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创建结构的东西

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;

然后在我的语义动作中使用该函数.

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

谢谢!

解决方法

据我所知 – 不.到目前为止还没有其他方法可以将其他可调用类型作为参数传递给phoenix :: function.当我尝试使用它时,我尝试使用C 11 lambdas并且因为Boost.ResultOf协议尝试使用某些参数调用phoenix :: function而失败.你可以在这个帖子中看到解释:
Can’t call a lazy lambda function with parameters via boost::phoenix::function.使用增强(BLL)和凤凰lambdas不是更短更轻.所以现在没有好的选择.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读