toStack method

StackX<T> toStack()

will convert iterable into a Stack data structure example: 1,2,3,4.toStack() stack.pop() stack.push(5)

Implementation

StackX<T> toStack() {
  final stack = StackX<T>();
  stack.addAll(this);
  return stack;
}