On 6/30/23 12:05, Cecil Ward wrote:
> I have code roughly like the following:
>
>     dstring str = "name"d;

Aside: One almost never needs dstring.

>     uint ordinal =  (( str in Decls.ordinals ) !is null)  ?
> Decls.ordinals[ str ]  :  -1;
>
> struct Decls
>     {
>     uint[ dstring]   ordinals;

Do you mean 'ordinals' is 'static'? Otherwise, Decls.ordinals does not compile.

>     }
>
> //and
>     Decls.ordinals[ str ] = ordinal_counter++;

Are you doing that *after* you initialize 'ordinal' as you show here? :)

Ali

Reply via email to