Compartir a través de


Set.empty Method

Definition

Determines whether the set is empty.

public:
 bool empty();
public bool empty ();
member this.empty : unit -> bool
Public Function empty () As Boolean

Returns

true if the set is empty; otherwise, false.

Remarks

This is equivalent to (elements() == 0).

The following example tests whether there are any elements in a set.

{ 
    Set mySet = new Set(Types::Integer); 
    ; 
    // ... 
    if (mySet.empty()) 
    { 
        print "There are no values in the set"; 
    } 
}

Applies to