Hello everyone)
Is using __PRETTY_FUNCTION__ macro good or bad practice for modern C++ development?
Recently we got a request to replace all __PRETTY_FUNCTION__s with Q_FUNC_INFO (project utilizes QT framework). But I can't understand the reason for these. I always thought it is a good think to stick with standard. Could you please provide your suggestions on this? Thanks))
__PRETTY_FUNCTION__ is a non-standard gnu extension __FUNCSIG__ is the equivalent non-standard microsoft extension Q_FUNC_INFO is the (presumably equivalent) non-standard qt extension
__func__ is standard C++; it gives just the name of the function
Boost has the portable macro BOOST_CURRENT_FUNCTION (#include <boost/current_function.hpp>)
which gives functionality akin to __PRETTY_FUNCTION__ / __FUNCSIG__
If the name of the function would suffice, use __func__
Otherwise use BOOST_CURRENT_FUNCTION