Home Dashboard Directory Help
Search

C++ Defect Report 445 Implementation by CornedBee


Status: 

Closed
 as Fixed Help for as Fixed


2
0
Sign in
to vote
Type: Bug
ID: 541226
Opened: 3/11/2010 6:24:25 AM
Access Restriction: Public
0
Workaround(s)
view
1
User(s) can reproduce this bug

Description

The C++03 standard contains a defect regarding the specification of iterators and especially their nested types. Basically, the reference and pointer nested types were underspecified. This was reported as DR445 to the LWG.

Under the resolution, an iterator's reference and pointer nested types now have to be the return types of its operator* and operator->, respectively. As part of this change, the specification of istreambuf_iterator has changed to make reference equal to value_type.

This resolution was adopted for the committee draft of C++0x in 2008, but can be found in working papers as early as N1804, published 2005-05. Despite this, the resolution still has not been implemented in the Visual Studio 2010 standard library: std::istreambuf_iterator<Ch>::reference is still Ch&.

This may seem subtle, but one consequence of this is that it is not possible to instantiate Boost.Spirit's multi_pass iterator adapter with istreambuf_iterator. This is problematic, because using istream_iterator instead involves a performance hit (dereferencing an istream_iterator is far more expensive than an istreambuf_iterator) as well as subtly changed semantics (whitespace skipping leads to bugs that are very hard to track down).
Details
Sign in to post a comment.
Posted by Microsoft on 11/1/2010 at 3:51 AM
Hi,

Thanks again for reporting this bug. We've fixed it, and the fix will be available in VC11.

As always, if you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by Microsoft on 3/12/2010 at 3:46 PM
Hi,

Thanks for reporting this bug. Although it's too late to fix this in VC10 RTM, we're keeping it active so that it can be fixed in a future release.

Note that decltype can now be used to figure out the return type of a function without having to be told by typedefs.

If you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by Microsoft on 3/12/2010 at 12:41 AM
Thank you for your feedback, We are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com).
Sign in to post a workaround.