ImmutableStack.Create Method

Definition

Overloads

Create<T>()

Creates an empty immutable stack.

Create<T>(ReadOnlySpan<T>)

Creates a new immutable stack that contains the specified array of items.

Create<T>(T)

Creates a new immutable stack that contains the specified item.

Create<T>(T[])

Creates a new immutable stack that contains the specified array of items.

Create<T>()

Source:
ImmutableStack.cs
Source:
ImmutableStack.cs
Source:
ImmutableStack.cs
Source:
ImmutableStack.cs

Creates an empty immutable stack.

public static System.Collections.Immutable.ImmutableStack<T> Create<T> ();

Type Parameters

T

The type of items to be stored in the immutable stack.

Returns

An empty immutable stack.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)
UWP 10.0

Create<T>(ReadOnlySpan<T>)

Source:
ImmutableStack.cs
Source:
ImmutableStack.cs
Source:
ImmutableStack.cs

Creates a new immutable stack that contains the specified array of items.

public static System.Collections.Immutable.ImmutableStack<T> Create<T> (ReadOnlySpan<T> items);
public static System.Collections.Immutable.ImmutableStack<T> Create<T> (scoped ReadOnlySpan<T> items);

Type Parameters

T

The type of items in the immutable stack.

Parameters

items
ReadOnlySpan<T>

A span that contains the items to prepopulate the stack with.

Returns

A new immutable stack that contains the specified items.

Applies to

.NET 9 and other versions
Product Versions
.NET 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

Create<T>(T)

Source:
ImmutableStack.cs
Source:
ImmutableStack.cs
Source:
ImmutableStack.cs
Source:
ImmutableStack.cs

Creates a new immutable stack that contains the specified item.

public static System.Collections.Immutable.ImmutableStack<T> Create<T> (T item);

Type Parameters

T

The type of items in the immutable stack.

Parameters

item
T

The item to prepopulate the stack with.

Returns

A new immutable collection that contains the specified item.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)
UWP 10.0

Create<T>(T[])

Source:
ImmutableStack.cs
Source:
ImmutableStack.cs
Source:
ImmutableStack.cs
Source:
ImmutableStack.cs

Creates a new immutable stack that contains the specified array of items.

public static System.Collections.Immutable.ImmutableStack<T> Create<T> (params T[] items);

Type Parameters

T

The type of items in the immutable stack.

Parameters

items
T[]

An array that contains the items to prepopulate the stack with.

Returns

A new immutable stack that contains the specified items.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)
UWP 10.0