I'm using TotalView 8.3.0-0 to debug c++ template. As I read in totalView user's guide, it is possible to break inside the template code. However when I compile and link the following code (using gcc 4.1.2: g++ -o power -g3 -O0 power.cpp), I cannot put the break point inside the template at all. If I break inside the main function and step-in, it simply goes to the end without stepping into the template. Could someone give me some suggestion? Can totalview debug C++ template?
Regards,
Marco
---------------------------------
template<long long X, long long Y>
struct ctime_pow {
static const long long result =
X * ctime_pow<X, Y-1>::result;
};
template<long long X>
struct ctime_pow<X,0> {
static const long long result = 1;
};
int main() {
cout << "The result of 7^3 is: " << ctime_pow<7, 3>::result << endl << endl;
}