is there any portable way of __PRETTY_FUNCTION

Discussion in 'C++' started by Nan Li, Apr 15, 2008.

  1. Nan Li

    Nan Li Guest

    Hi,
    g++ has a predefined macro __PRETTY_FUNCTION. I think it is a gcc
    extension. Is there anything equivalent that is defined in the
    standard or any library ( e.g. BOOST, ACE )?

    Thanks,
    Nan
     
    Nan Li, Apr 15, 2008
    #1
    1. Advertising


  2. > g++ has a predefined macro __PRETTY_FUNCTION. I think it is a gcc
    > extension. Is there anything equivalent that is defined in the
    > standard or any library ( e.g. BOOST, ACE )?


    Don't take this for granted, but I've read somewhere, that there will be
    something in the standard which is named __func__ which gives the
    function name, but not in that detail like __PRETTY_FUNCTION__. I don't
    know how many compiler already implement this, but it is much more
    portable than __PRETTY_FUNCTION__. But if you use g++, you can try, g++
    implements both.

    hth,
    Michael
     
    Michael Oswald, Apr 16, 2008
    #2
    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. Eli Bendersky
    Replies:
    1
    Views:
    1,170
    Mike Treseler
    Mar 1, 2006
  2. Voronkov Konstantin
    Replies:
    1
    Views:
    407
    Victor Bazarov
    Sep 9, 2004
  3. Voronkov Konstantin
    Replies:
    2
    Views:
    4,495
    Stephan Br?nnimann
    Sep 10, 2004
  4. Voronkov Konstantin
    Replies:
    0
    Views:
    284
    Voronkov Konstantin
    Sep 10, 2004
  5. Replies:
    7
    Views:
    920
Loading...

Share This Page