digitalmars.D - base class protection
- qniol <qniol o2.pl> Jun 20 2009
- Daniel Keep <daniel.keep.lists gmail.com> Jun 20 2009
- Frank Benoit <keinfarbton googlemail.com> Jun 20 2009
- Jarrett Billingsley <jarrett.billingsley gmail.com> Jun 20 2009
Hello!
What's "protection" here for?
class Duper : protection Super { ... }
for protection being either:
private
package
public
export
and Super being a class.
C++'s intuition let me down. D 1.0/2.0 ref. too (I got accustomed to it).
thx for help!
Jun 20 2009
qniol wrote:Hello! What's "protection" here for? class Duper : protection Super { ... } for protection being either: private package public export and Super being a class.
As far as I know, it doesn't *do* anything.C++'s intuition let me down. D 1.0/2.0 ref. too (I got accustomed to it). thx for help!
You'll have to be more specific about ref for us to be of assistance.
Jun 20 2009
Daniel Keep schrieb:qniol wrote:Hello! What's "protection" here for? class Duper : protection Super { ... } for protection being either: private package public export and Super being a class.
As far as I know, it doesn't *do* anything.
As far as I know, it *does* break compatibility with "Object". http://d.puremagic.com/issues/show_bug.cgi?id=177
Jun 20 2009
On Sat, Jun 20, 2009 at 4:51 AM, qniol<qniol o2.pl> wrote:Hello! What's "protection" here for? class Duper : protection Super { ... } for protection being either: private package public export and Super being a class.
It's a remnant from presumably an earlier period in D's development. Without MI, it's pointless. The default is public, and using anything other than public just breaks things. I'm surprised (well,.. not really) that it's been in the spec and compiler for so long without having been removed.
Jun 20 2009









Frank Benoit <keinfarbton googlemail.com> 