File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ namespace SC
1515// /
1616// / Example:
1717// / \snippet Tests/Libraries/Foundation/FunctionTest.cpp FunctionMainSnippet
18- template <typename FuncType>
18+ template <typename FuncType, int LAMBDA_SIZE = sizeof ( void *) * 2 >
1919struct Function ;
2020
21- template <typename R, typename ... Args>
22- struct Function <R(Args...)>
21+ template <int LAMBDA_SIZE, typename R, typename ... Args>
22+ struct Function <R(Args...), LAMBDA_SIZE >
2323{
2424 private:
2525 enum class Operation
@@ -37,8 +37,6 @@ struct Function<R(Args...)>
3737 OperationFunction operation;
3838 };
3939
40- static const int LAMBDA_SIZE = sizeof (void *) * 2 ;
41-
4240 const VTable* vtable;
4341
4442 union
@@ -57,7 +55,7 @@ struct Function<R(Args...)>
5755 // / @brief Constructs an empty Function
5856 Function ()
5957 {
60- static_assert (sizeof (Function) == sizeof (void *) * 3 , " Function Size" );
58+ static_assert (sizeof (Function) == sizeof (void *) + LAMBDA_SIZE , " Function Size" );
6159 vtable = nullptr ;
6260 }
6361
You can’t perform that action at this time.
0 commit comments