This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to print the return value of template member functions (C++)?


Hi,

I have the following C++ program. I try to print a.get<0>(). But I
failed. Do you know how to do it?


Thanks, Peng

$ cat main.cc
#include <boost/tuple/tuple.hpp>
#include <iostream>

int main() {
 boost::tuple<int, int> a(10, 10);
 std::cout << a.get<0>() << " " << a.get<1>() << std::endl;
}


(gdb) p a.get<0>() Couldn't find method boost::tuples::tuple<int,int,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type>::get<0>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]