This is the mail archive of the 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 a template member function


I have the following program listed below this email. I want to
inspect 'a.get<0>()' from gdb. But I got the following error message.
Can you show me what the right way should be?

(gdb) start
Breakpoint 1 at 0x80489a4: file, line 5.
[Thread debugging using libthread_db enabled]
[New Thread -1217684800 (LWP 6424)]
[Switching to Thread -1217684800 (LWP 6424)]
main () at
5         boost::tuple<int, int> a(10, 10);
(gdb) n
6         std::cout << a.get<0>() << " " << a.get<1>() << std::endl;
(gdb) p a.get<0>()
Couldn't find method


$ cat
#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;

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