mem_fun_ref: parens in reference of function

Discussion in 'C++' started by tibirna@gmail.com, Feb 3, 2006.

  1. Guest

    Hello

    mem_fun_ref(&(std::list<int>::size))

    is compiled as valid by gcc 3.3.4 and causes an error ("defined-id
    needed") with gcc 4.0.2. The later requires

    mem_fun_ref(&std::list<int>::size)

    Is there a some subtle issue that the compiler has to comply with when
    it refuses the parens? Or is this a compiler bug?

    Thanks
    , Feb 3, 2006
    #1
    1. Advertising

  2. wrote:

    > mem_fun_ref(&(std::list<int>::size))
    >
    > is compiled as valid by gcc 3.3.4 and causes an error ("defined-id
    > needed") with gcc 4.0.2. The later requires
    >
    > mem_fun_ref(&std::list<int>::size)
    >
    > Is there a some subtle issue that the compiler has to comply with when
    > it refuses the parens? Or is this a compiler bug?


    Comeau agrees with gcc 4.0.2, so it seems likely that 4.0.2 is correct.

    Best regards,

    Tom
    Thomas Tutone, Feb 3, 2006
    #2
    1. Advertising

  3. Guest

    ICC 8.1 accepts the first form no problem :-|
    , Feb 3, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Anders

    mem_fun_ref

    Anders, Jun 30, 2003, in forum: C++
    Replies:
    2
    Views:
    1,664
    tom_usenet
    Jul 1, 2003
  2. Jan Rendek
    Replies:
    0
    Views:
    490
    Jan Rendek
    Jul 15, 2003
  3. tmak
    Replies:
    3
    Views:
    1,108
  4. Replies:
    0
    Views:
    82
  5. Bart Lateur
    Replies:
    2
    Views:
    72
    Bart Lateur
    Sep 3, 2007
Loading...

Share This Page