Method get_iterator()
- Method get_iterator
Iteratorget_iterator(object|array|mapping|multiset|stringdata)- Description
Creates and returns a canonical iterator for data.
- Returns
datacan have any of the following types:objectIf data is an object with lfun::_get_iterator defined then it's called in it to create the iterator.
If data is an object that lacks lfun::_get_iterator then it's assumed to already be an iterator object, and is simply returned.
arrayIf data is an array, an Array.Iterator object will be returned.
mappingIf data is a mapping, a Mapping.Iterator object will be returned
multisetIf data is a multiset, a Multiset.Iterator object will be returned
stringIf data is a string, a String.Iterator object will be returned
- Note
This function is used by
foreachto get an iterator for an object.- See also
- Method get_iterator
Iteratorget_iterator(object|array|mapping|multiset|stringdata)- Description
Creates and returns a canonical iterator for data.
- Returns
datacan have any of the following types:objectIf data is an object with lfun::_get_iterator defined then it's called in it to create the iterator.
If data is an object that lacks lfun::_get_iterator then it's assumed to already be an iterator object, and is simply returned.
arrayIf data is an array, an Array.Iterator object will be returned.
mappingIf data is a mapping, a Mapping.Iterator object will be returned
multisetIf data is a multiset, a Multiset.Iterator object will be returned
stringIf data is a string, a String.Iterator object will be returned
- Note
This function is used by
foreachto get an iterator for an object.- See also