I
Ioannis Vranos
I want to see whether I made some mistake before submitting this as a bug:
#include <algorithm>
#include <functional>
#include <list>
inline bool SomeFunc (const int a, const int b)
{
return a==b;
}
class Foo
{
std::list<int> someList;
public:
void f()
{
using namespace std;
remove_if(someList.begin(), someList.end(),
bind2nd(ptr_fun(SomeFunc), 10));
}
};
int main()
{
}
C:\c>cl /EHsc temp.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.40904 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
temp.cpp
C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(320) :
error C2
535: 'bool std::binder2nd<_Fn2>:perator ()(const int &) const' :
member functi
on already defined or declared
with
[
_Fn2=std:ointer_to_binary_function<const int,const
int,bool,bool (
__cdecl *)(const int,const int)>
]
C:\Program Files\Microsoft Visual Studio
8\VC\include\functional(314) :
see declaration of 'std::binder2nd<_Fn2>:perator ()'
with
[
_Fn2=std:ointer_to_binary_function<const int,const
int,bool,bool (
__cdecl *)(const int,const int)>
]
temp.cpp(22) : see reference to class template instantiation
'std::binde
r2nd<_Fn2>' being compiled
with
[
_Fn2=std:ointer_to_binary_function<const int,const
int,bool,bool (
__cdecl *)(const int,const int)>
]
C:\c>
#include <algorithm>
#include <functional>
#include <list>
inline bool SomeFunc (const int a, const int b)
{
return a==b;
}
class Foo
{
std::list<int> someList;
public:
void f()
{
using namespace std;
remove_if(someList.begin(), someList.end(),
bind2nd(ptr_fun(SomeFunc), 10));
}
};
int main()
{
}
C:\c>cl /EHsc temp.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.40904 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
temp.cpp
C:\Program Files\Microsoft Visual Studio 8\VC\include\functional(320) :
error C2
535: 'bool std::binder2nd<_Fn2>:perator ()(const int &) const' :
member functi
on already defined or declared
with
[
_Fn2=std:ointer_to_binary_function<const int,const
int,bool,bool (
__cdecl *)(const int,const int)>
]
C:\Program Files\Microsoft Visual Studio
8\VC\include\functional(314) :
see declaration of 'std::binder2nd<_Fn2>:perator ()'
with
[
_Fn2=std:ointer_to_binary_function<const int,const
int,bool,bool (
__cdecl *)(const int,const int)>
]
temp.cpp(22) : see reference to class template instantiation
'std::binde
r2nd<_Fn2>' being compiled
with
[
_Fn2=std:ointer_to_binary_function<const int,const
int,bool,bool (
__cdecl *)(const int,const int)>
]
C:\c>