c++.beta - Is this an error
- smille mail.com (19/19) Apr 18 2003 // try this piece of source codes
// try this piece of source codes #include <iostream.h> template <const char *& STR> struct TEST { TEST() { cout << *STR << endl; // is this weird } }; const char *g = "Hello World"; int main() { TEST<g> obj; return 0; } // The running results are (of course) Hello World // but if I use STR instead of *STR in the TEST template, I got some address. The compiler I used is the 8.34 beta5
Apr 18 2003