cast<R> method

ImmortalSet<R> cast<R>()

Returns a copy of this set casting all elements to instances of R.

If this set contains only instances of R, the new set will be created correctly, otherwise an exception will be thrown.

Implementation

ImmortalSet<R> cast<R>() => ImmortalSet(_set.cast<R>());