为什么以下代码会生成error C2440: 'initializing' : cannot convert from 'Bar **' to 'Foo **'. Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast.
struct Foo
{
};
struct Bar : Foo
{
};
int main()
{
Bar **ppb = nullptr;
Foo **ppf = ppb;
return 0;
}
Aren的Foo和Bar相关,所以向上指向指针从一个到另一个应该有效吗?