Home Dashboard Directory Help
Search

Can not convert pointer to static member function to std::function by Evgeniy A. Dushistov


Status: 

Active


1
0
Sign in
to vote
Type: Bug
ID: 800814
Opened: 9/15/2013 7:48:57 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Code below cause compilation error on VS 2012, but it compiles without problem gcc,clang, icc and VS 2013 RC.
It would be nice, if you fix this in next VS 2012 update.

#include <functional>

struct Foo {
    template<typename T>
    static void f(int);
};

template<>
void Foo::f<int>(int) {}

int main()
{
    std::function<void(int)> func;
    func = Foo::f<int>;//compilation failure
}
Details
Sign in to post a comment.
Posted by Evgeniy A. Dushistov on 9/16/2013 at 4:26 PM
>The bug has already been fixed in Visual Studio 2013, so are you requesting that we release the fix in an update to Visual Studio 2012?

Yes, VS 2013 is unstable now, and when Release (not RC) occures who knows.
It would be nice to fix this issue in the stable version of VS. It is not new feature,
it is just thing that should works, but doesn't.

>Is this an urgent issue?

It is rather annoying to use static_cast every time to workaround this bug.
Posted by Microsoft on 9/16/2013 at 3:14 PM
Hi Evgeniy,

The bug has already been fixed in Visual Studio 2013, so are you requesting that we release the fix in an update to Visual Studio 2012? Is this an urgent issue?

Karl Niu
VC++ Team
Posted by Microsoft on 9/16/2013 at 5:38 AM
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 Microsoft on 9/15/2013 at 7:52 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.