diff --git a/src/lib/local-slice.hpp b/src/lib/local-slice.hpp index 83855218d..22c8132af 100644 --- a/src/lib/local-slice.hpp +++ b/src/lib/local-slice.hpp @@ -41,22 +41,29 @@ namespace lib { + + /** Extension point for LocalSlice: Service initialisation */ + template + struct LocalSlice_DefaultSetup + { + using Service = SRV; + static Service init() { return Service(); } + }; + /** * Common access point to thread-local service instances. - * @tparam CONF static config / setup to initialise the service. + * @tparam CONF setup to initialise the service. */ - template - class LocalSlice + template> + struct LocalSlice { - using Service = CONF::Service; - - public: LocalSlice() = default; - // using default copy/assignment + using Service = CONF::Service; + /** service access */ Service& operator*() const diff --git a/tests/lib/local-slice-test.cpp b/tests/lib/local-slice-test.cpp index 86bda458a..36761565c 100644 --- a/tests/lib/local-slice-test.cpp +++ b/tests/lib/local-slice-test.cpp @@ -57,14 +57,7 @@ namespace test { } }; - struct DummySetup - { - using Service = DummyBackend; - - static Service init() { return Service(); } - }; - - using DummySlice = LocalSlice; + using DummySlice = LocalSlice; /** diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 2b4513227..b17a58fa2 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -144308,6 +144308,47 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) + + + + + + + + + + + + +

+ man muß den aktuellen Namespace schließen, in lib gehen, dort die explizite Spezialisierung definieren... +

+ + +
+ +
+ + + + + + + + + +

+ direkt bei LocalSlice definiert; erzeugt eine default-konstruierte Instanz vom Service +

+ + +
+
+ + + +
+