> Hello im using Visual Studio .net
And have troubel with the following line
ClassA::~ClassA()
{
cerr<<__PRETTY_FUNCTION__<<"\n"; \\this works with g++
}
on compiling I get this back:
filename.cc(20): error C2065: '__PRETTY_FUNCTION__' : undeclared
identifier
does exist an library to add or have I just missed an command?
__PRETTY_FUNCTION__ is not part of standard C++ but a g++ specific
extension. Consequently you cannot expect every compiler to support
this. If you are satisfied with just file name and line number you might
use a macro like this:
#define PRETTY_FUNCTION __FILE__":" << __LINE__
The predefined macro __FILE__ and __LINE__ are defined in the C++
standard, and should be available on any reasonable compilant C++
compiler. Note that this macro is not an exact equivalent for the
__PRETTY_FUNCTION__ macro; it only works for stream output. With a bit
more effort it can be modified to produce a string.
--
Peter van Merkerk
peter.van.merkerk(at)dse.nl