
Hello, All! I write example code for tuples::tuple::get use tuples::tie. If compile icl (Intel C++) v 7.1 or bcc32 (Borland) v 5.6.4 all ok, but if compile g++ (GCC) v 3.2.2 or cl (MSVC) v 13.00.9466 - i have eror. ;-c I need to use it in MSVC. Help me! ========tie.cpp======== #include <iostream> #include <boost/tuple/tuple.hpp> using std::cout; using std::endl; template <int num, typename T> void print(T t) { int i1 = 0, i2 = 0, i3 = 0; char c1 = '\0', c2 = '\0', c3 = '\0'; using boost::tuples::tie; tie(i1, i2, i3, c1, c2, c3).get<num>() = t; //Error in g++ & cl cout<<tie(i1, i2, i3, c1, c2, c3).get<num>()<<endl; //Error in g++ & cl } int main() { print<0>(0); print<1>(1); print<2>(2); print<3>('a'); print<4>('b'); print<5>('c'); return 0; } ========tie.cpp======== ========g++ command line====== c:\g++ -Iboost -otie tie.cpp ========g++ command line====== ========g++ output====== tie.cpp: In function `void print(T)': tie.cpp:12: parse error before `)' token tie.cpp:13: parse error before `)' token ========g++ output====== ========cl command line====== c:\cl /EHsc tie.cpp ========cl command line====== ========cl output====== tie.cpp(12) : error C2039: 'get' : is not a member of 'boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' with [ T1=boost::tuples::detail::assign_to_pointee<int>, T2=boost::tuples::detail::assign_to_pointee<int>, T3=boost::tuples::detail::assign_to_pointee<int>, T4=boost::tuples::detail::assign_to_pointee<char>, T5=boost::tuples::detail::assign_to_pointee<char>, T6=boost::tuples::detail::assign_to_pointee<char>, T7=boost::tuples::null_type, T8=boost::tuples::null_type, T9=boost::tuples::null_type, T10=boost::tuples::null_type ] tie.cpp(17) : see reference to function template instantiation 'void print<0,int>(T)' being compiled with [ T=int ] tie.cpp(12) : error C2059: syntax error : ')' tie.cpp(13) : error C2039: 'get' : is not a member of 'boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' with [ T1=boost::tuples::detail::assign_to_pointee<int>, T2=boost::tuples::detail::assign_to_pointee<int>, T3=boost::tuples::detail::assign_to_pointee<int>, T4=boost::tuples::detail::assign_to_pointee<char>, T5=boost::tuples::detail::assign_to_pointee<char>, T6=boost::tuples::detail::assign_to_pointee<char>, T7=boost::tuples::null_type, T8=boost::tuples::null_type, T9=boost::tuples::null_type, T10=boost::tuples::null_type ] tie.cpp(13) : error C2059: syntax error : ')' tie.cpp(12) : error C2039: 'get' : is not a member of 'boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' with [ T1=boost::tuples::detail::assign_to_pointee<int>, T2=boost::tuples::detail::assign_to_pointee<int>, T3=boost::tuples::detail::assign_to_pointee<int>, T4=boost::tuples::detail::assign_to_pointee<char>, T5=boost::tuples::detail::assign_to_pointee<char>, T6=boost::tuples::detail::assign_to_pointee<char>, T7=boost::tuples::null_type, T8=boost::tuples::null_type, T9=boost::tuples::null_type, T10=boost::tuples::null_type ] tie.cpp(18) : see reference to function template instantiation 'void print<1,int>(T)' being compiled with [ T=int ] tie.cpp(12) : error C2059: syntax error : ')' tie.cpp(13) : error C2039: 'get' : is not a member of 'boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' with [ T1=boost::tuples::detail::assign_to_pointee<int>, T2=boost::tuples::detail::assign_to_pointee<int>, T3=boost::tuples::detail::assign_to_pointee<int>, T4=boost::tuples::detail::assign_to_pointee<char>, T5=boost::tuples::detail::assign_to_pointee<char>, T6=boost::tuples::detail::assign_to_pointee<char>, T7=boost::tuples::null_type, T8=boost::tuples::null_type, T9=boost::tuples::null_type, T10=boost::tuples::null_type ] tie.cpp(13) : error C2059: syntax error : ')' tie.cpp(12) : error C2039: 'get' : is not a member of 'boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' with [ T1=boost::tuples::detail::assign_to_pointee<int>, T2=boost::tuples::detail::assign_to_pointee<int>, T3=boost::tuples::detail::assign_to_pointee<int>, T4=boost::tuples::detail::assign_to_pointee<char>, T5=boost::tuples::detail::assign_to_pointee<char>, T6=boost::tuples::detail::assign_to_pointee<char>, T7=boost::tuples::null_type, T8=boost::tuples::null_type, T9=boost::tuples::null_type, T10=boost::tuples::null_type ] tie.cpp(19) : see reference to function template instantiation 'void print<2,int>(T)' being compiled with [ T=int ] tie.cpp(12) : error C2059: syntax error : ')' tie.cpp(13) : error C2039: 'get' : is not a member of 'boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' with [ T1=boost::tuples::detail::assign_to_pointee<int>, T2=boost::tuples::detail::assign_to_pointee<int>, T3=boost::tuples::detail::assign_to_pointee<int>, T4=boost::tuples::detail::assign_to_pointee<char>, T5=boost::tuples::detail::assign_to_pointee<char>, T6=boost::tuples::detail::assign_to_pointee<char>, T7=boost::tuples::null_type, T8=boost::tuples::null_type, T9=boost::tuples::null_type, T10=boost::tuples::null_type ] tie.cpp(13) : error C2059: syntax error : ')' tie.cpp(12) : error C2039: 'get' : is not a member of 'boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' with [ T1=boost::tuples::detail::assign_to_pointee<int>, T2=boost::tuples::detail::assign_to_pointee<int>, T3=boost::tuples::detail::assign_to_pointee<int>, T4=boost::tuples::detail::assign_to_pointee<char>, T5=boost::tuples::detail::assign_to_pointee<char>, T6=boost::tuples::detail::assign_to_pointee<char>, T7=boost::tuples::null_type, T8=boost::tuples::null_type, T9=boost::tuples::null_type, T10=boost::tuples::null_type ] tie.cpp(20) : see reference to function template instantiation 'void print<3,char>(T)' being compiled with [ T=char ] tie.cpp(12) : error C2059: syntax error : ')' tie.cpp(13) : error C2039: 'get' : is not a member of 'boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' with [ T1=boost::tuples::detail::assign_to_pointee<int>, T2=boost::tuples::detail::assign_to_pointee<int>, T3=boost::tuples::detail::assign_to_pointee<int>, T4=boost::tuples::detail::assign_to_pointee<char>, T5=boost::tuples::detail::assign_to_pointee<char>, T6=boost::tuples::detail::assign_to_pointee<char>, T7=boost::tuples::null_type, T8=boost::tuples::null_type, T9=boost::tuples::null_type, T10=boost::tuples::null_type ] tie.cpp(13) : error C2059: syntax error : ')' tie.cpp(12) : error C2039: 'get' : is not a member of 'boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' with [ T1=boost::tuples::detail::assign_to_pointee<int>, T2=boost::tuples::detail::assign_to_pointee<int>, T3=boost::tuples::detail::assign_to_pointee<int>, T4=boost::tuples::detail::assign_to_pointee<char>, T5=boost::tuples::detail::assign_to_pointee<char>, T6=boost::tuples::detail::assign_to_pointee<char>, T7=boost::tuples::null_type, T8=boost::tuples::null_type, T9=boost::tuples::null_type, T10=boost::tuples::null_type ] tie.cpp(21) : see reference to function template instantiation 'void print<4,char>(T)' being compiled with [ T=char ] tie.cpp(12) : error C2059: syntax error : ')' tie.cpp(13) : error C2039: 'get' : is not a member of 'boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' with [ T1=boost::tuples::detail::assign_to_pointee<int>, T2=boost::tuples::detail::assign_to_pointee<int>, T3=boost::tuples::detail::assign_to_pointee<int>, T4=boost::tuples::detail::assign_to_pointee<char>, T5=boost::tuples::detail::assign_to_pointee<char>, T6=boost::tuples::detail::assign_to_pointee<char>, T7=boost::tuples::null_type, T8=boost::tuples::null_type, T9=boost::tuples::null_type, T10=boost::tuples::null_type ] tie.cpp(13) : error C2059: syntax error : ')' tie.cpp(12) : error C2039: 'get' : is not a member of 'boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' with [ T1=boost::tuples::detail::assign_to_pointee<int>, T2=boost::tuples::detail::assign_to_pointee<int>, T3=boost::tuples::detail::assign_to_pointee<int>, T4=boost::tuples::detail::assign_to_pointee<char>, T5=boost::tuples::detail::assign_to_pointee<char>, T6=boost::tuples::detail::assign_to_pointee<char>, T7=boost::tuples::null_type, T8=boost::tuples::null_type, T9=boost::tuples::null_type, T10=boost::tuples::null_type ] tie.cpp(22) : see reference to function template instantiation 'void print<5,char>(T)' being compiled with [ T=char ] tie.cpp(12) : error C2059: syntax error : ')' tie.cpp(13) : error C2039: 'get' : is not a member of 'boost::tuples::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>' with [ T1=boost::tuples::detail::assign_to_pointee<int>, T2=boost::tuples::detail::assign_to_pointee<int>, T3=boost::tuples::detail::assign_to_pointee<int>, T4=boost::tuples::detail::assign_to_pointee<char>, T5=boost::tuples::detail::assign_to_pointee<char>, T6=boost::tuples::detail::assign_to_pointee<char>, T7=boost::tuples::null_type, T8=boost::tuples::null_type, T9=boost::tuples::null_type, T10=boost::tuples::null_type ] tie.cpp(13) : error C2059: syntax error : ')' ========cl output====== With best regards, nagual. E-mail: nagual@promsoft.ru