std::forward_iterator_tag derives from std::output_iterator_tag - by mfhava

Status : 


Sign in
to vote
ID 775231 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 12/27/2012 10:53:08 AM
Access Restriction Public


The current implementation of IteratorTags has the following error:
std::forward_iterator_tag derives from std::output_iterator_tag and std::input_iterator_tag. According to the current standard it should ONLY derive from std::input_iterator_tag!
Sign in to post a comment.
Posted by Deon [MSFT] on 4/29/2014 at 12:31 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from:
Posted by Stephan [MSFT] on 2/11/2013 at 4:18 PM

Thanks for reporting this bug. We've fixed it, and the fix will be available in VC12. (Our version numbers are: VC8 = VS 2005, VC9 = VS 2008, VC10 = VS 2010, VC11 = VS 2012.)

With my fix, forward_iterator_tag no longer derives from output_iterator_tag. However, this wasn't a one-line fix. We had many algorithm helpers overloaded on (input, output) versus (random, random) to perform additional range-checking in debug mode when possible. My fix introduces an internal tag that both output_iterator_tag and forward_iterator_tag derive from, and modifies the algorithm helpers accordingly. This internal tag does not affect strictly conforming user code, so it is "invisible".

Note: Connect doesn't notify me about comments. If you have any further questions, please E-mail me.

Stephan T. Lavavej
Senior Developer - Visual C++ Libraries
Posted by Microsoft on 1/2/2013 at 12:18 AM
Hi DEB5F, thanks for your help.
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by mfhava on 12/28/2012 at 11:25 AM
The standard defines the hierarchy of the tags in §24.3:
struct input_iterator_tag { };
struct output_iterator_tag { };
struct forward_iterator_tag: public input_iterator_tag { };
struct bidirectional_iterator_tag: public forward_iterator_tag { };

The current implementation is located in your internal header file: "xutility"
Posted by Microsoft on 12/27/2012 at 11:46 PM
Hi DEB5F, please help me find the definition. Thanks.
Posted by Microsoft on 12/27/2012 at 11:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(