8 May
2009
8 May
'09
1:14 p.m.
AMDG simon Ye wrote:
boost::tuple provide a member template function get to gain a element of tuple, As following:
#include "boost\tuple\tuple.hpp" using namespace boost;
template<typename T> class TA{public: template
void testfun(T1 e1, T2 e2) { tuple t1(e1, e2); //T1 _e1 = t1.template get<0>(); //works *T1 _e1 = t1.get<0>(); //works for boost::tuple* /* However, according c++98, t1.get<0>() seems to should be encounter a compilor error. *I want to known how boost::tuple avoid this compile error.* */ } };
The form that you've commented out is the correct syntax.
You cannot use just t1.get<0>() because tuple