9
我得到了类,看起来在这个模板方法:的boost :: enable_if类模板方法
struct undefined {};
template<typename T> struct is_undefined : mpl::false_ {};
template<> struct is_undefined<undefined> : mpl::true_ {};
template<class C>
struct foo {
template<class F, class V>
typename boost::disable_if<is_undefined<C> >::type
apply(const F &f, const V &variables) {
}
template<class F, class V>
typename boost::enable_if<is_undefined<C> >::type
apply(const F &f, const V &variables) {
}
};
显然,这两个模板被实例化,导致编译时错误。 是与实例化自由函数不同的模板方法的实例吗? 我已经解决了这个问题,但我想知道什么是。 我能想到的唯一的事情可能会导致这种现象,使条件不依赖直接的模板参数,而是类模板参数
谢谢
谢谢你一次。 – Anycorn 2010-05-30 04:26:43