Can this be done in C++?
←Older revision | Revision as of 08:36, 12 September 2012 | ||
Line 68: | Line 68: | ||
In this case '''people''' class is the only one to access the ''prev''/''next'' field. So the encapsulation is kept. On the other hand, this is not generic support. One needs to write the code again and again. | In this case '''people''' class is the only one to access the ''prev''/''next'' field. So the encapsulation is kept. On the other hand, this is not generic support. One needs to write the code again and again. | ||
+ | |||
+ | An attempt to provide general support for such list was provided on the [[Talk:Trait|discussion page]], but while being generic and efficient, it is not really type-safe. |