您好,我从使用 VS 2013 RC 构建的 trunk 获得了最新的 Boost。内置 boost,它起作用了。
但是在针对 Boost 编译我的项目时,我使用了 Boost Fusion。我收到了 100 条这样的错误消息——
错误 1086 error C3520: 'T' : 必须在此上下文中扩展参数包
引用make_vector10.hpp中这段代码
namespace result_of
{
template <typename T0 , typename T1 , typename T2>
struct make_vector<T0 , T1 , T2>
{
typedef vector3<typename detail::as_fusion_element<T0>::type , typename detail::as_fusion_element<T1>::type , typename detail::as_fusion_element<T2>::type> type;
};
}
但是这里的任何地方都没有使用模板参数“T”。
这也不是可变参数模板,所以我不明白为什么它在错误消息中引用参数包。 “vector3”和“as_fusion_element”也不是可变的。
make_vector 的所有变体都给我同样的错误 btw(也是 make_set)。
有人知道这是怎么回事吗?谢谢
这是一个最小的复制
#include <boost/fusion/container.hpp>
#include <boost/fusion/algorithm.hpp>
#include <boost/fusion/include/algorithm.hpp>
#include <boost/fusion/sequence.hpp>
#include <boost/fusion/include/sequence.hpp>
#include <boost/fusion/support/pair.hpp>
#include <boost/fusion/include/pair.hpp>
namespace fs = boost::fusion;
namespace Key {
struct prep_table{}; struct draw_single{};
};
int main() {
fs::map<std::pair<Key::prep_table, float>, std::pair<Key::draw_single, int>> Blah;
return 0;
}
最佳答案
这是一个compiler bug正如 Felix Petroconi 在评论中所报道的那样。
解决方法:获得最新的 boost ,但将 fusion 回滚到早期版本
关于c++ - VS 2013 RC 中的 Boost Fusion 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18878655/