From 7a614686c8899ef66f99c1136282c33f9922749f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Masiukiewicz?= Date: Tue, 8 Nov 2022 22:05:57 +0100 Subject: [PATCH] Export id generated by becsID --- source/bubel/ecs/traits.d | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/bubel/ecs/traits.d b/source/bubel/ecs/traits.d index 15880fd..42b1753 100644 --- a/source/bubel/ecs/traits.d +++ b/source/bubel/ecs/traits.d @@ -11,8 +11,11 @@ import std.traits; */ ref ushort becsID(T)() { - __gshared ushort id = ushort.max; - return id; + /// Embed id in struct so export can be added to variable definition + static struct LocalStruct { + export __gshared ushort id = ushort.max; + } + return LocalStruct.id; } /************************************************************************************************************************