We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
using
1 parent 61313f0 commit 69e97f2Copy full SHA for 69e97f2
1 file changed
util/callable.hh
@@ -76,7 +76,19 @@ private:
76
template<typename Signature>
77
using Function = FunctionSized<sizeof(void *) * 2, Signature>;
78
79
+
80
template<unsigned size = sizeof(void *) * 2>
-using CallbackSized = FunctionSized<size, void(void)>;
81
+struct CallbackSized : FunctionSized<size, void(void)>{
82
+ CallbackSized() = default;
83
84
+ template<typename Callable>
85
+ CallbackSized(Callable callable) : FunctionSized<size, void(void)>{callable}{}
86
87
+};
88
+// Note: we could just define CallbackSized like the following, but
89
+// that breaks the API for functions using CallbackSized in their signature
90
+// template<unsigned size = sizeof(void *) * 2>
91
+// using CallbackSized = FunctionSized<size, void(void)>;
92
93
using Callback = CallbackSized<2 * sizeof(void *)>;
94
0 commit comments