From: Leigh Johnston on
The following doesn't compile in VS2008:

#include <functional>

struct foo
{
void operator()() { }
};

int main()
{
foo o;
std::tr1::bind(o)();
}

Has this been fixed in VS2010?

/Leigh

From: Jeff Flinn on
Leigh Johnston wrote:
> The following doesn't compile in VS2008:

What's the error message? Do either of the inline changes below help?

> #include <functional>
>
> struct foo
> {
typedef void result_type;

> void operator()() { }
> };
>
> int main() {
> foo o;
> std::tr1::bind(o)();

std::tr1::bind<void>(o)();
> }
>
> Has this been fixed in VS2010?


Jeff
From: Leigh Johnston on


"Jeff Flinn" <Jeff(a)news.microsoft.com> wrote in message
news:Or6nw$rvKHA.5812(a)TK2MSFTNGP02.phx.gbl...
> Leigh Johnston wrote:
>> The following doesn't compile in VS2008:
>
> What's the error message? Do either of the inline changes below help?
>
>> #include <functional>
>>
>> struct foo
>> {
> typedef void result_type;
>
>> void operator()() { }
>> };
>>
>> int main() {
>> foo o;
>> std::tr1::bind(o)();
>
> std::tr1::bind<void>(o)();
>> }
>>
>> Has this been fixed in VS2010?
>
>
> Jeff

Doesn't help, the problem is the operator()() is not const and for some
reason VS2008 will only consider the const version and error otherwise:

1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\xxcallobj(7)
: error C3848: expression having type 'const foo' would lose some
const-volatile qualifiers in order to call 'void foo::operator ()(void)'



From: David Lowndes on
>The following doesn't compile in VS2008:
>
>#include <functional>
>
>struct foo
>{
> void operator()() { }
>};
>
>int main()
>{
> foo o;
> std::tr1::bind(o)();
>}
>
>Has this been fixed in VS2010?

It's the same with the VC2010 RC compiler.

Dave
From: Leigh Johnston on


"David Lowndes" <DavidL(a)example.invalid> wrote in message
news:sb9ap5he6g7s88j7ifkj0kgaegivaqpftn(a)4ax.com...
>>The following doesn't compile in VS2008:
>>
>>#include <functional>
>>
>>struct foo
>>{
>> void operator()() { }
>>};
>>
>>int main()
>>{
>> foo o;
>> std::tr1::bind(o)();
>>}
>>
>>Has this been fixed in VS2010?
>
> It's the same with the VC2010 RC compiler.
>
> Dave

I will raise a defect on MS Connect.

/Leigh