私はこれを見るテンプレートメソッドを持つクラスを取得しました:
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) {
}
};
明らかに、両方のテンプレートがインスタンス化され、コンパイル時エラーが発生します。テンプレートメソッドのインスタンス化は、無料の関数のインスタンス化とは異なりますか?これを別の方法で修正しましたが、何が起きているのか知りたいです。私が考えることができる唯一のことは、この動作を引き起こす可能性があります。有効化条件は、即時のテンプレート引数ではなく、クラステンプレート引数に依存します。
ありがとうございました