const methods()

BCS ao at pathlink.com
Mon Jan 22 15:23:36 PST 2007


Reply to mike,

> So what should I do until an alternative arrives? Just hope that no
> one messes with my sensitive class objects?
> 

Its really hacky but you might be able to make something like this work


interface C
{
  int nonConst();
}

private ConstC : C
{
  int nonConst(){assert(0);}
}

private NonConstC : C
{
  int nonConst() {/*go*/}
}


having a const and non const view might be really messy (nested non private 
classes maybe?)

On second thought, you'd better not





More information about the Digitalmars-d mailing list