title: Is there a way to get the line number with out a macro in c++?
body: <p>I am writing a logger and I would like the logger to also record which line, function, and file called it. I have tried <code>#define my_logger(format, ...) _log(format, __LINE__, __PRETTY_FUNCTION__, __FILE__, __VA_ARGS__)</code> which works however, this leads to several problems for me (I can't easily overload it, I can't put it in a namespace, not the most portable, etc).</p>
  <p>Is there a way where I can declare a normal function like <code>void my_logger(const char* format, ...)</code> and in the function definition have it know the line it was called from with something equivilent to <code>__LINE_FUNCTION_WAS_CALLED_FROM__</code> if such macro existed? At a minimum it needs to work on GCC and really should be cross-platform.</p>
  <p>Edit: By cross-platform, I only mean Linux and Windows on x86 and ARM</p>