This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
How to print the return value of template member functions (C++)?
- From: "Peng Yu" <pengyu dot ut at gmail dot com>
- To: gdb at sourceware dot org
- Date: Wed, 3 Jan 2007 19:04:52 -0600
- Subject: 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>