Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is __PRETTY_FUNCTION__ called __PRETTY_FUNCTION__?

I see __PRETTY_FUNCTION__ used a lot in answers to questions on this site, and I understand the usefulness of this function, but why exactly is it called __PRETTY_FUNCTION__? It's not an ugly function, but it's not exactly pretty either.

like image 343
Carter Pape Avatar asked May 02 '12 20:05

Carter Pape


1 Answers

I think it is called __PRETTY_FUNCTION__ because it is a "decorated" __FUNCTION__ (at least in C++, in C they are both equivalent). In C++, the return type and the parameters type are also displayed.

Note that both __PRETTY_FUNCTION__ and __FUNCTION__ are not C but GNU C. __func__ is C.

like image 115
ouah Avatar answered Nov 15 '22 17:11

ouah