Why can't we define re-assignable const reference variable?

Sergey Gromov snake.scaly at gmail.com
Wed Feb 20 12:40:12 PST 2008


Steven Schveighoffer <schveiguy at yahoo.com> wrote:
> > The traditional usage of parentheses is this: foo(x).  This means that a
> > function foo is applied to its argument x, and not applied to everything
> > else.  You are probably talking about some different tradition.  Please
> > clarify.
> 
> That is the usage I am referring to.  I'll spell it out in English:
> 
> class C means that C is equivalent to a "reference to a some data" that 
> compromises the class that follows the given definition.

At least, now I understand why we can't understand each other.

For a declaration,

C x;

you imply reference in C, and I imply reference in x.

const(C) x;   	// text written
const(C) (ref x);	// my understanding
const(C ref) x;	// your understanding

No wonder we can't agree.  Now I'm curious why the difference.  To me, C 
is a class, and x is a reference.  Why it's different for you ?

-- 
SnakE



More information about the Digitalmars-d mailing list