digitalmars.D.learn - (How) can reflection recoginzie `extern` variables?
- Quirin Schroll (6/6) Oct 11 ```d
- Salih Dincer (6/12) Oct 11 There is no __traits mechanism to directly determine whether a
- Salih Dincer (8/10) Oct 11 ```d
```d extern int x; /****/ int y; ``` (How) can I get the information that `x` is `extern` and `y` is not? There seems to be no `__traits` for it.
Oct 11
On Friday, 11 October 2024 at 16:33:55 UTC, Quirin Schroll wrote:```d extern int x; /****/ int y; ``` (How) can I get the information that `x` is `extern` and `y` is not? There seems to be no `__traits` for it.There is no __traits mechanism to directly determine whether a symbol is extern. However, the extern linkage is determined at compile time based on how the symbol is defined, and the type of linkage it uses is determined by the compiler. SDB 79
Oct 11
On Friday, 11 October 2024 at 17:58:00 UTC, Salih Dincer wrote:There is no __traits mechanism to directly determine ...```d extern int x; int y; pragma(msg, __traits(isSame, y, x)); ``` I tried it now, but as I said, it wouldn't be unreasonable: SDB 79
Oct 11