diff --git a/src/lib/meta/util.hpp b/src/lib/meta/util.hpp index e7479e61e..3d09630a1 100644 --- a/src/lib/meta/util.hpp +++ b/src/lib/meta/util.hpp @@ -136,9 +136,28 @@ namespace meta { + namespace { + template + struct _ExtractFirst + { + using Type = void; + }; + template + struct _ExtractFirst + { + using Type = X; + }; + } + /** helper to extract the first argument from a variadic arg pack, if any */ + template + using extractFirst_t = typename _ExtractFirst::Type; + + + /** helper to prevent a template constructor from shadowing inherited copy ctors */ - template - using disable_if_self = disable_if, SELF>>; + template + using disable_if_self = disable_if>> + , SELF>>; diff --git a/src/lib/random-draw.hpp b/src/lib/random-draw.hpp index a4690d2d2..2c235a40d 100644 --- a/src/lib/random-draw.hpp +++ b/src/lib/random-draw.hpp @@ -282,7 +282,7 @@ namespace lib { * - `void(RandomDraw&, ...)` : the function manipulates the current * instance, to control parameters dynamically, based on input. */ - template> + template> RandomDraw(FUN&& fun) : Lazy{Disabled()} , probability_{1.0} diff --git a/src/vault/gear/special-job-fun.hpp b/src/vault/gear/special-job-fun.hpp index b557a74dc..5c6a35dc2 100644 --- a/src/vault/gear/special-job-fun.hpp +++ b/src/vault/gear/special-job-fun.hpp @@ -164,7 +164,7 @@ namespace gear { * this reference is dangling and using it further will * lead to SEGFAULT or memory corruption. */ - template> + template> explicit SpecialJobFun (FUN&& someFun) : _Handle{selfAttached (new SpecialExecutor(forward (someFun)))} diff --git a/tests/library/lazy-init-test.cpp b/tests/library/lazy-init-test.cpp index 83ed1d05d..9180a70c9 100644 --- a/tests/library/lazy-init-test.cpp +++ b/tests/library/lazy-init-test.cpp @@ -357,7 +357,7 @@ namespace test{ installInitialiser(fun, buildInit([](int){ return 0; })); } // prevent this ctor from shadowing the copy ctors //////TICKET #963 - template> + template> LazyDemo (FUN&& someFun) : LazyInit{MarkDisabled()} , fun{}