Re: std::tr1::function wierdness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Montag, 10. Juli 2006 17:59 schrieb Adrian Harris:

> int main()
> {
...
>      B b2( DefaultFnObj() ); // this line compiles (1)
>
>      return rc0 + rc1 + b2.fn(); //this line has the error (2)
> }


b2 is not an object here. It is an function declaration. You have a function 
declared that takes a DefaultFnObj and returns a B. To get rid of the error:

B b2( (DefaultFnObj()) );

See Item 6:

http://www.accu.org/mdevelopers/projects/effectivecpp/estl_items.html

Christoph

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux