C++ Frontend Tales

All | Boost | General | Loki
« Yes, I did it again.... | Main | Test results by... »

20060226 Sunday February 26, 2006

Two small steps

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
template 
struct 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 );
}

Permalink Comments [2]
Trackback URL: http://blogs.sun.com/sga/entry/two_small_steps
Comments:

Hello, one thing surprises me in the results you publish: studio 10 seems to work much better than studio 11. How come?

Posted by Marc on February 27, 2006 at 02:53 PM MSK #

would be handy to see mpl to work. right is not most awkward of all boost libraries but also amongst the best documented (Abrahams & Gurtovoy). Secondly, ACE+TAO (Schmidt et al.) And last but not least of course to get a proper install of QT .. there seem to be some quirks with getting it to install in the first place and then to call some functions from it using Sun Studio 11

Posted by christian a. hehn on May 18, 2006 at 08:10 PM MSD #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed