Skip to content

Commit

Permalink
Containers: implement arbitrary array insertion.
Browse files Browse the repository at this point in the history
Not the most efficient implementation yet -- it's quite a lot of new
logic to make it efficient, so doing it gradually instead. See the TODOs
in the code.
  • Loading branch information
mosra committed Jun 21, 2022
1 parent 25e2ce0 commit bcdbde2
Show file tree
Hide file tree
Showing 4 changed files with 956 additions and 17 deletions.
2 changes: 2 additions & 0 deletions doc/corrade-changelog.dox
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ namespace Corrade {
- New @ref Containers::ArrayView2, @ref Containers::ArrayView3 and
@ref Containers::ArrayView4 convenience aliases for
@ref Containers::StaticArrayView
- Added a family of @ref Containers::arrayInsert() functions for arbitrary
insertion into growable arrays

@subsubsection corrade-changelog-latest-new-pluginmanager PluginManager library

Expand Down
10 changes: 5 additions & 5 deletions src/Corrade/Containers/Array.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ custom allocators, type constructibility and such.
As long as the type stored in the array is nothrow-move-constructible, any
@ref Array instance can be converted to a growing container by calling the
family of @ref arrayAppend(), @ref arrayReserve(), @ref arrayResize() ...
functions. A growable array behaves the same as a regular array to its
consumers --- its @ref size() returns the count of *real* elements, while
available capacity can be queried through @ref arrayCapacity(). Example of
populating an array with an undetermined amount of elements:
family of @ref arrayAppend(), @ref arrayInsert(), @ref arrayReserve(),
@ref arrayResize() ... functions. A growable array behaves the same as a
regular array to its consumers --- its @ref size() returns the count of *real*
elements, while available capacity can be queried through @ref arrayCapacity().
Example of populating an array with an undetermined amount of elements:
@snippet Containers.cpp Array-growable
Expand Down
Loading

0 comments on commit bcdbde2

Please sign in to comment.