【初心者歓迎】C/C++室 Ver.77【環境依存OK】at TECH
【初心者歓迎】C/C++室 Ver.77【環境依存OK】 - 暇つぶし2ch524:デフォルトの名無しさん
12/01/21 12:59:38.80
// func.cpp
namespace {
template <unsigned int R> inline BigInt Factor(BigInt const & n) { return n == 0 ? 1 : n * Factor<R - 1>(n - 1); }
template <> inline BigInt Factor<0>(BigInt const & n) { return n == 0 ? 1 : n * Factor<256>(n - 1); }
}
BigInt factor(BigInt const & n) { return Factor<256>(n) ; }

// func.hpp
BigInt factor(BigInt const & n);


こんな感じのコードを見かけたんですけどこのテンプレートになにか意味あるんですか?


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch