The Software Purist |

Apr/13

17

Forgotten C++ Macros

The joys of exploring the depths of C++. So, I was looking at the assert macro and I completely forgot about one of the macros it makes use of. It seems we commonly make use of __FILE__, __LINE__, __FUNCTION__, etc… But I completely forgot about __BASE_FILE__. This actually gives you the compilation unit, rather than the file that got included. This is pretty helpful, actually. Here’s a reference for the standard C++ macros:

I think I may make use of __BASE_FILE__ more often.

No tags

No comments yet.

Leave a Reply

<<

>>

Theme Design by devolux.nh2.me