Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

[rt/aaA] Add _aaNew function to initialize AA #3863

Merged
merged 2 commits into from
Jul 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/rt/aaA.d
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,20 @@ pure nothrow @nogc unittest
// API Implementation
//------------------------------------------------------------------------------

/** Allocate associative array data.
* Called for `new SomeAA` expression.
* Params:
* ti = TypeInfo for the associative array
* Returns:
* A new associative array.
*/
extern (C) AA _aaNew(const TypeInfo_AssociativeArray ti)
{
AA aa;
aa.impl = new Impl(ti);
return aa;
}

/// Determine number of entries in associative array.
extern (C) size_t _aaLen(scope const AA aa) pure nothrow @nogc
{
Expand Down