|
-
char* cp = char*(); // is a syntax error
-
However,
#include <iostream>
using namespace std;
template< typename ValueT >
class Thing {
public:
Thing< ValueT >()
{
ValueT dummy = ValueT();
// dummy is zero if ValueT is a pointer:
std::cout << static_cast< void* >( dummy );
}
};//class Thing
int main()
{
Thing< char* > thing;
return 0;
}
|