【发布时间】:2013-05-17 23:02:39
【问题描述】:
对于 Boost Proto 表达式,我什么时候不应该期待 proto_tag 成员?我可以使用以下任一方法查询占位符的标签类型:
typedef proto::tag_of<decltype(_1)>::type ta;
typedef decltype(_1)::proto_tag tb;
但是如果我询问表达式的child 的标签类型,似乎proto_tag 成员不存在;并且以下代码的第三行给出了错误:
auto f = _1 + _2;
typedef proto::tag_of<decltype(proto::child_c<0>(f))>::type tc;
typedef decltype(proto::child_c<0>(f))::proto_tag td; // error
Clang 和 GCC 的错误报告有问题的类型:不是类、命名空间或范围枚举。我使用 Clang 3.2、GCC 4.7.2 和 Boost 1.53。
【问题讨论】:
标签: c++ boost typetraits boost-proto