Range (computer programming): Difference between revisions

Content deleted Content added
Undid revision 988965225 by Net1Samad (talk)
m Enum 1 author/editor WL; WP:GenFixes on
Line 1:
{{RefimproveMore citations needed|date=December 2006}}
In [[computer science]], the term '''range''' may refer to one of three things:
# The possible values that may be stored in a [[variable (programming)|variable]].
Line 15:
== Range as an alternative to iterator ==
Another meaning of ''range'' in computer science is an alternative to [[iterator]]. When used in this sense, range is defined as "a pair of begin/end iterators packed together".<ref name="itersmustgo">{{Cite web
| author = [[Andrei Alexandrescu]]
| author-link = Andrei Alexandrescu
| title = Iterators Must Go
| url = https://accu.org/content/conf2009/AndreiAlexandrescu_iterators-must-go.pdf
Line 21 ⟶ 22:
| accessdate = 29 July 2014
| publisher = BoostCon 2009
}}</ref> It is argued <ref name="itersmustgo" /> that "Ranges are a superior abstraction" (compared to iterators) for several reasons, including better safety.
 
In particular, such ranges are supported in [[Boost C++ Libraries]]<ref>[http://www.boost.org/libs/range/index.html Boost.Range documentation]</ref> and the [[D (programming language)|D]] standard library.<ref>[http://dlang.org/phobos/std_range.html D Phobos Runtime Library std.range module]</ref>
Line 29 ⟶ 30:
 
== References ==
{{reflistReflist}}
 
{{DEFAULTSORT:Range (Computer Science)}}