Aliases
Walter Bright
newshound at digitalmars.com
Mon Oct 23 02:29:04 PDT 2006
Bill Baxter wrote:
> Walter Bright wrote:
>> RE: errors
>>
>> I wrote those on the assumption they'd be inside a function. As
>> globals, they won't work, but in general things line int[2] shouldn't
>> be globals.
>
> Those were in a class.
Glad you told me that, because I couldn't duplicate the errors.
The first one works as:
> class Foo
> {
> int[2] nodes;
> int left() { return nodes[0]; }
> int right() { return nodes[1]; }
> }
And the other:
> class Foo
> {
> void DoSomething() { }
> }
>
> class FooHandle
> {
> Foo myFoo;
> void DoSomething() { myFoo.DoSomething(); }
> }
More information about the Digitalmars-d
mailing list