
Pretty ugly :) ________________________________ Von: Marsh Ray <marsh@extendedsubset.com> An: boost@lists.boost.org Gesendet: Sonntag, den 1. Mai 2011, 18:38:09 Uhr Betreff: Re: [boost] [BOOST CORE C++ Feature] the super or base keyword for C++ On 05/01/2011 12:54 AM, tymofey wrote:
>>I was wondering if it makes sense to add the well known super or base keyword to the C++ language in a generic way.
C++ has multiple inheritance, while java and C# do not, so super would be ambigous.
class B1 { int i; float f; }; class B2 { int j; float f; }; class D : B1, B2 { int i, j; float f; void fn() { ... int v = super::i; // refers to B1::i int w = super::j; // refers to B2::j float x = super::f; // error: ambiguous float y = super<B1>::f; // refers to B1::f float z = super<B2>::f; // refers to B2::f ... } }; How ugly would the macros have to get to implement something like this with the current standards? - Marsh _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost