Hmm - about manifest/enum

Janice Caron caron800 at googlemail.com
Tue Jan 1 09:27:56 PST 2008


On 1/1/08, Bill Baxter <dnewsgroup at billbaxter.com> wrote:
> What was the fundamental problem with creating some syntax that would
> let you peel the reference part off a class reference?

It needs to be defined for all types, not just classes. If C is a
class, and we define

    const(C)&

to mean mutable-reference-to-const-data, then you have only
/partially/ defined &. You need to define it for all types. You need
to define what

    const(T)&

means, for all possible types T. You need to define it for each of the cases:

    T is a primitive type
    T is a pointer to U
    T is an array of U
    T is an associative array of U[V]
    T is a struct
    T is a union
    T is a function
    T is a delegate
    T is a typedef
    T is a named enum

Until it is fully defined, it is not possible to discuss its
consequences. The fundamental problem is, things start to fall over
when you start trying to define it for struct and union.



More information about the Digitalmars-d mailing list