On occasion I\'ve seen some really indecipherable error messages spit out by gcc
when using templates... Specifically, I\'ve had problems where seemingly correc
#include
class A {
public:
typedef int my_t;
};
template
class B {
public:
// T::my_t *ptr; // It will produce compilation error
typename T::my_t *ptr; // It will output 5
};
int main() {
B b;
int my_int = 5;
b.ptr = &my_int;
std::cout << *b.ptr;
std::cin.ignore();
return 0;
}