is there any portable way of __PRETTY_FUNCTION

N

Nan Li

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
 
M

Michael Oswald

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top