#include <list>
#include <boost/tuple/tuple.hpp>
template<class InputIterator>
void f(InputIterator it)
{
typedef boost::tuple<typename InputIterator::value_type, int> Pair;
std::list<Pair> paired;
typename std::list<Pair>::const_iterator output;
for(output=paired.begin(); output!=paired.end(); ++output)
{
output->get<1>();
}
}
このテンプレート関数を使用してライブラリを取得しています。Gcc 4.1.2(codepad.org)は次のエラーを報告します:
In function 'void f(InputIterator)':
Line 12: error: expected primary-expression before ')' token
compilation terminated due to -Wfatal-errors.
テンプレートの経験が豊富な人がアドバイスを提供できますか?自分自身を研究するための問題またはキーフレーズのどちらか?これは私を立ち往生させています。