nextElem is a generic function used to produce values. If a
checkFunc was specified to the constructor, the potential
iterated values will be passed to the checkFunc until the
checkFunc returns TRUE. When the iterator has no more
values, it calls stop with the message 'StopIteration'.
Usage
nextElem(obj, …)
# S3 method for containeriter
nextElem(obj, …)
# S3 method for funiter
nextElem(obj, …)