c++ - Get file and line of calling function -
i'm trying write class logs calls operator=
don't know of away without changing calling code. function signature adjust, might work: how know function called another, don't see how work function operator=
. possible?
example class/usage:
template <typename t> class loggingt { t data; loggingt& operator=(const loggingt& rhs){ data = rhs; std::cout << "assigned @ line: " << ???? << " in file " << ???? << std::endl; return *this; };
Comments
Post a Comment