Prev: Why doesn't VS2008 detect this warning
Next: throwing an exception... on behalf of another thread
From: Leigh Johnston on 6 Mar 2010 06:38 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 8 Mar 2010 08:07 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 8 Mar 2010 10:19 "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 8 Mar 2010 11:30 >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 8 Mar 2010 12:20 "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
|
Next
|
Last
Pages: 1 2 Prev: Why doesn't VS2008 detect this warning Next: throwing an exception... on behalf of another thread |