ruba
ruba

Reputation: 120

VS2012 bind2nd is not a member of std

I had some code already working on vs2008 and I am trying to port it to vs2012. On this source code I am using the function bind2nd specified and using std::bind2nd and everything works perfectly. When I compile the same code with vs2012 I get an error saying that bind2nd is not a member of std. I checked on msdn and it says that is part of the "functional" library. When I look for it on my box I found out that it is not in there but in xfunctional, which is included on functional when rc_invoked is not defined. My first thought was that I had rc_invoked defined but i proved that it is not. So, following the chain of includes this bind2nd should be part of std and my code shouldn't be failing, but it is. I run out of ideas so any thought will be welcome.

Cheers

Upvotes: 3

Views: 3997

Answers (1)

Vlad from Moscow
Vlad from Moscow

Reputation: 310950

I have no MS VC++ 2012 but you should check that maybe bind2nd is defined in some name space that is enclosed in std::namespace or there is some manifest constant that need to be defined that to use bind2nd. Though it looks strange if you explicitly included header <functional> in your program.

Upvotes: 2

Related Questions