Super easy struct construction question that I'm embarrassed to ask.

WhatMeWorry kheaser at gmail.com
Fri Jan 10 16:41:54 UTC 2025


> struct Node
> {
>   uint multiplier;
>   Location location;
>
>   this(Location locaction, uint multiplier)
>   {
>     this.location = location * multiplier;
>     this.multiplier = multiplier;
>   }
>
> }

I appreciate your example of the robustness of D, but if I was to 
make the same syntax  mistake:

this(Location locaction, uint multiplier)  // extraneous letter

it returns same error:

n = Node(33, Location(0, 0))

I guess there is no fix for stupidity on my part. :)



More information about the Digitalmars-d-learn mailing list