[Issue 5279] Function-static associative arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 26 15:54:29 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=5279


nfxjfg at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nfxjfg at gmail.com


--- Comment #4 from nfxjfg at gmail.com 2010-11-26 15:53:05 PST ---
Wouldn't that lead exactly to the same race condition prone crap C++ is doing
when it comes to initialization of static variables inside functions?

Just say no.

Immutable data (or de-facto immutable data only accessible through const) is
another story, though.

(In reply to comment #1)
> I would expect that this problem would be solved together with however being
> able to use Objects with CTFE and dynamic memory in general is solved. Since, I
> believe that it's essentially the same problem that won't allow you to
> initialize a global variable which is a class type to anything other than null.
> CTFE can't handle the heap yet. Once it can, AAs should work.

It's not that easy. The AA has to be allocated in the heap (to deal with later
write accesses to the AA). How can CTFE allocate heap memory at the program's
runtime? Obviously this doesn't work.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list