Alois Kraus


  Home  |   Contact  |   Syndication    |   Login
  124 Posts | 8 Stories | 330 Comments | 162 Trackbacks


Article Categories


Post Categories

Image Galleries


April 2012 Entries

Good things are hard to kill. One of the most useful predefined compiler macros in C/C++ were __FILE__ and __LINE__ which do expand to the compilation units file name and line number where this value is encountered by the compiler. After 4.5 versions of .NET we are on par with C/C++ again. It is of course not a simple compiler expandable macro it is an attribute but it does serve exactly the same purpose. Now we do get CallerLineNumberAttribute == __LINE__ CallerFilePathAttribute == __FILE__ CallerMemberNameAttribute ......