|
Boost : |
Subject: Re: [boost] [BOOST CORE C++ Feature] the super or base keyword for C++
From: Max Hölzer (max.hoelzer_at_[hidden])
Date: 2011-05-03 13:21:09
Pretty ugly :)
________________________________
Von: Marsh Ray <marsh_at_[hidden]>
An: boost_at_[hidden]
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk