[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: equivalent for C-style init: structname varname[] = {...} ?

From: Jordi Gutiérrez Hermoso
Subject: Re: equivalent for C-style init: structname varname[] = {...} ?
Date: Mon, 19 Nov 2012 10:47:23 -0500

On 19 November 2012 10:34, Dimitri Maziuk <address@hidden> wrote:
> Any yes, if they're hashmaps then obviously "foo bar" is a valid map key,
> but "a( 3 ).foo bar" is not a valid syntax. Because the space between foo
> and bar is a token separator.

They are not in any sense of the word hash maps for a very simple
reason: there is absolutely no hashing involved. The internal
implementation uses C++'s std::map, which as you probably know, is
usually a red-black tree. In particular, lookups are O(log(n)), not

Structs are not hashes, but they can be seen, with some stretch of the
imagination, as arrays where one dimension is indexed by variable

- Jordi G. H.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]