Input iterator & Output iterator: nine people from 10 can't tell a story clearly.

Source: Internet
Author: User

I picked "no" and said:

Input iterator: * The operation returns a constant reference. Constant operations. In short, values cannot be attached, they cannot be modified, and values cannot be attached. They can be copied and compared.

 

Output iterator: * The operation is a non-constant operation and returns a reference. In short, * the operation changes the state. value that can be modified. it cannot be compared and copied (because it cannot be used to obtain data without modification, similar to auto_ptr ). Interestingly, difference_type is forcibly disabled because it cannot be compared (the values have changed once compared ).

 

Therefore, forward_iterator and output _ terator are not related to "Isa.

 

STD: iostream and its sub-classes are the product of the chaotic logic of the standard committee and the use of multi-inheritance. A typical example is STD :: Fstream is rarely used. rapidxml and minini use the File * operation very honestly.

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.