C++ Logo


Advanced search

Subject: Fwd: Parent pointer to access the parent class from member
From: Hanspeter Bieri-Ineichen (bieri.hp_at_[hidden])
Date: 2020-06-28 17:17:48

The important ability of C/C++ that classes can be direct members of a
class allows to access them by a this-pointer offset instead of a pointer

To access the parent class from a member the usual way is to store a
pointer to the parent. There no simple way that uses the member offset. A
template solution is shown here:

Would it be useful to have something like a parent pointer similar to the

STD-DISCUSSION list run by herb.sutter at gmail.com

Older Archives on Google Groups