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 1 commit
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
8 changes: 8 additions & 0 deletions src/rt/aaA.d
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,14 @@ pure nothrow @nogc unittest
// API Implementation
//------------------------------------------------------------------------------

/// Allocate new AA implementation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add documentation like e.g. #3865 (cc @dkorpel)
In particular, mention when this function is called by the compiler.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated docs.

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