【激突】関数型言語 VS オブジェクト指向言語
■ このスレッドは過去ログ倉庫に格納されています
0269デフォルトの名無しさん
2012/03/20(火) 00:45:16.30関数型言語って、チャーチ数見たいに
関数自体をデータとして扱えるってのは必須要件なのかね?
template<class> struct F;
template<class> struct Count;
template<class type> struct Count< F<type> >
{
enum{ value = Count< type >::value + 1 };
}
template<> struct Count< void >
{
enum{ value = 0 };
};
Count< F< F< F< F<void> > > >::value == 4;
■ このスレッドは過去ログ倉庫に格納されています