瀏覽代碼

clarify Iterator.next behavior (see #3908)

Simon Krajewski 10 年之前
父節點
當前提交
a4bd0b1e90
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      std/StdTypes.hx

+ 5 - 2
std/StdTypes.hx

@@ -94,8 +94,11 @@ typedef Iterator<T> = {
 	/**
 		Returns the current item of the Iterator and advances to the next one.
 
-		This method is not required to check hasNext() first. A call to this
-		method while hasNext() is false yields unspecified behavior.
+		This method is not required to check `hasNext` first. A call to this
+		method while `hasNext` is false yields unspecified behavior.
+
+		On the other hand iterators should not require a call to `hasNext`
+		before the first call to `next` if an element is available.
 	**/
 	function next() : T;