Search

Argument Dependent Lookup Failure in Visual C++ 2010 by hanji

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 714628
Opened: 12/19/2011 7:10:43 AM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
0
User(s) can reproduce this bug
The following code snippet fails to compile under Visual C++ 2010:

template<typename T>
std::vector<T>
fun(const std::vector<T>& a, const std::vector<T>& b)
{
    std::vector<T> nrv;
    std::unordered_set<T> s(b.begin(), b.end());
    // msvc10 fails to find `remove_copy_if', where it should.
    remove_copy_if(a.begin(), a.end(), back_inserter(nrv), [&](T v) { return s.find(v) != s.end(); });
    return nrv;
}
Details (expand)

Visual Studio/Team Foundation Server/.NET Framework Tooling version

Visual Studio 2010 SP1

Steps to reproduce

A sample program is available at https://gist.github.com/1495787 .

Strip the leading `std::' at line 64, and the program would fail to compile under Visual C++ 2010.

Product Language

English

Operating System

Windows 7

Operating System Language

English (US)

Actual results

compilation error

Expected results

compilation success
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 1/9/2012 at 4:38 PM
Hi: this issue has been fixed. The fix should show up in a future release of Visual C++.

Thank you for reporting the issue.

Jonathan Caves
Visual C++ Compiler Team
Posted by MS-Moderator10 [Feedback Moderator] on 12/20/2011 at 12:48 AM
Thank you for submitting feedback on Visual Studio 2010 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 MS-Moderator01 on 12/19/2011 at 7:42 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.