Home Dashboard Directory Help
Search

Cannot call static member functions of template types directly from lambdas in C++. by Benjamin Lindley


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 703088
Opened: 11/13/2011 12:57:01 PM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Failure to compile when trying to call a static member function of a type T from a lambda within a function template.
Details
Sign in to post a comment.
Posted by Microsoft on 12/9/2011 at 7:25 PM
Hi -

We have fixed this issue for the next major release. Thank you for reporting it.

Andy Rich
Visual C++ QA
Posted by MS-Moderator07 [Feedback Moderator] on 11/13/2011 at 6:52 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Posted by MS-Moderator01 on 11/13/2011 at 1:42 PM
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.
Posted by Benjamin Lindley on 11/13/2011 at 1:00 PM
Get a function pointer to the static member function, then call that from within the lambda:

template<typename T>
void example()
{
auto func = T::bar;
[]() { func(); }();
}