Sunday February 26, 2006 Sorry, small improvements only.
| Studio 11 | Studio 10 | |
|---|---|---|
| Pass | 697 | 726 |
| Warn | 154 | 155 |
| Fail | 98 | 68 |
Now users of Sun Studio C++ is able to define template friend function in the class body.
% cat test.cc templatestruct S { typedef T type; template friend void foo(U p1, S & p2) { // compiler could not find S and T typename S::type v; T p; } };
And use dependent template types with nested template arguments (see example below).
struct S
{
template < class SigArgs >
struct sig
{
typedef typename SigArgs :: head_type type;
};
};
template
struct cons
{
typedef Z head_type;
};
// compiler could not deduce return type
template
typename T1 :: template sig < cons > :: type
foo(T1, T2);
void test()
{
S v;
int i = foo( v, 1 );
}
Posted by Marc on February 27, 2006 at 02:53 PM MSK #
Posted by christian a. hehn on May 18, 2006 at 08:10 PM MSD #