This is a VC bug. The same code compiles fine with gcc ,for example.
In C++, if you *declare* a function with a const parameter, the
'const' modifier is *ignored*. Therefore, your Some_interface is
equivalent to:
struct Some_interface {
virtual void f(int i) = 0; // int or const int? Makes no difference.
};
In fact, you can *declare* f() with an int parameter, and *define* it
with a 'const int' parameter. The compiler will still match them up.
Since 'const' is meaningless in the method *declaration*, I recommend
you to remove it in both Some_interface and Some_mock. That should
workaround the VC bug.
>
> Thanks for any help,
> andrew
>
--
Zhanyong
I added an FAQ for this:
>
>>
>> Thanks for any help,
>> andrew
>>
>
>
>
> --
> Zhanyong
>
--
Zhanyong