class Foo{};
class BarParent
{
Foo* p_foo;
public:
BarParent(Foo * const p_x) //OR BarParent(Foo const * x) OR BarParent(Foo * x)
//OR (Foo const * const x)
{
p_foo = x;
}
};
class BarChild: public BarParent
{
public:
BarChild(const Foo& x)
: BarParent(& x){}
};
私が意図しているのは、 ctorを使用するときにx
withを指すことです。そうする方法はありますか?p_foo
BarChild
BarParent
ctorのすべての可能な署名を試してみましたが、うまくいきませんでした。
概要:何らかの理由で、(非const
オブジェクトへのポインター) を (オブジェクトへ制限const
が破られるconst