Skip to content

Commit 7d098e1

Browse files
committed
method array::emplace
1 parent 24dc631 commit 7d098e1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/base/tl/array.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,16 @@ class array : private ALLOCATOR
213213
return list[index];
214214
}
215215

216+
/*
217+
Function: emplace
218+
*/
219+
T &emplace()
220+
{
221+
incsize();
222+
set_size(size() + 1);
223+
return list[num_elements - 1];
224+
}
225+
216226
/*
217227
Function: base_ptr
218228
*/

0 commit comments

Comments
 (0)