Possible very buggy situation

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>::blush:perator ()(const int &) const' :
member functi
on already defined or declared
with
[
_Fn2=std::pointer_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>::blush:perator ()'
with
[
_Fn2=std::pointer_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::pointer_to_binary_function<const int,const
int,bool,bool (
__cdecl *)(const int,const int)>
]

C:\c>
 
C

Carl Daniel [VC++ MVP]

Ioannis said:
I want to see whether I made some mistake before submitting this as a
bug:

Looks like a bug to me.

- Comeau likes it.

- You're not (re)defining std::binder2nd<>::blush:perator()(const int&), so it's
hard to imagine how the error VC8 is giving could be anything other than a
bug.

-cd
 
I

Ioannis Vranos

Carl said:
Looks like a bug to me.

- Comeau likes it.

- You're not (re)defining std::binder2nd<>::blush:perator()(const int&), so it's
hard to imagine how the error VC8 is giving could be anything other than a
bug.

OK I will submit it as a bug, however keep in mind that VC++ 7.1 has the
same problem with it too.
 
I

Ioannis Vranos

Ioannis said:
OK I will submit it as a bug, however keep in mind that VC++ 7.1 has the
same problem with it too.


Submitted as a bug with the title "binder1st - binder2nd unexpected errors".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top