www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17593] New: __POS__ magical constant like __FILE__ and friends

https://issues.dlang.org/show_bug.cgi?id=17593

          Issue ID: 17593
           Summary: __POS__ magical constant like __FILE__ and friends
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: eyal weka.io

Add __POS__ as a more concise (__FILE__, __MODULE__, __LINE__).

Add a "struct Pos { string file, module; size_t line; }" in a core library
somewhere.

Add a __POS__ magical constant that evaluates to Pos(__FILE__, __MODULE__,
__LINE__) but is evaluated at the correct position (equivalent to manually
placing __FILE__, __MODULE__, __LINE__ into separate compile-time variables.

--
Jul 04