www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13752] New: add traits to query storage class of variables

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

          Issue ID: 13752
           Summary: add traits to query storage class of variables (isTLS,
                    isGlobal)
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

Knowing whether a variable is thread-local (TLS) sometimes allows to leave-out
otherwise necessary synchronization.
Currently it's extremely hacky to infer this, so a isTLS trait would be
helpful.
It might also make sense to add the complements isGlobal and isLocal.

http://dpaste.dzfl.pl/ed0b271d434b

--
Nov 19 2014