help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Workaround for a g++ 3.4.2 bug?


From: BigMan
Subject: Workaround for a g++ 3.4.2 bug?
Date: 29 Mar 2005 22:36:33 -0800
User-agent: G2/0.2

Well... g++ 3.4.2 (mingw-special) won't compile the following code. It
says:

In function `void f2()':
error: cannot convert `int s::*' to `int*' for argument `1' to `void
f(int*)'

void f( int* )
{
}

struct s
{
        static int i;
};

template< typename t >
void f2( )
{
        f( &s::i ); // won't compile
}

void f3( )
{
        f( &s::i ); // compiles fine
}

I think that this is a compiler bug and I'm looking for a workaround.
Could anyone suggest smth?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]