System.Generics.Collections.TStack.Push

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Push(const Value: T); inline;

C++

void __fastcall Push(const T Value);

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Generics.Collections.pas
System.Generics.Collections.hpp
System.Generics.Collections TStack

Description

Push stack item.

This method inserts one item onto the top of the stack. Count is incremented by 1. You can push nil onto the stack. The stack's capacity is automatically increased if necessary.

An OnNotify event occurs indicating an item was added to the stack.

This is a O(1) operation unless the capacity must increase. In this case, it is O(n), where n is Count.

See Also

Code Examples