Code: Select all
namespace {
template <typename T> struct Foo {
Foo( T const& val ) : mVal( val ) {}
void test() {}
T mVal;
};
} // namespace
void MyNamespace::callTest() {
Foo<double> f1( 42.0 ).test();
}
Code: Select all
Error: Unexpected type name "::Foo<double>" encountered.
Error: The function "f1" must have a prototype.
Error: Badly formed expression.
Code: Select all
void MyNamespace::callTest() {
Foo<double> f1( 42.0 );
f1.test();
}
For the curious, the compiler is Sun C++ 5.8 Patch 121017-01.