The difference between range in D and ienumreable in C #

Source: Internet
Author: User

The basic range uses the interface function front, popfront, empty three functions, as long as the implementation of these three functions, is a range. Using these three functions to access the element represents an ordered collection, so it can be called a sequence set, which is a queue-style operation.

In C #, ienumreable only requires access to elements, and there is no ordered requirement, which is the same as the Opapply interface in C #.

In the D language there are two iterations, one is to implement front, Popfront, empty these three interfaces, the other is to implement the Opapply interface, as long as one can be implemented using foreach iterative access.

Note that only objects that implement the Opapply interface can be accessed using foreach, and he is not a range.

In Inputrange, it is more stringent, need to implement the above two interfaces is a inputrange.

The difference between range in D and ienumreable in C #

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.