B
BigMan
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
}
Who's wrong here? Is it the compiler or is it me?
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
}
Who's wrong here? Is it the compiler or is it me?