1 #pragma clang system_header 2 3 template <typename T, typename CreateFunction> callMethod(CreateFunction createFunction)4void callMethod(CreateFunction createFunction) { 5 createFunction()->method(); 6 } 7 8 template <typename T, typename CreateFunction> localVar(CreateFunction createFunction)9inline void localVar(CreateFunction createFunction) { 10 T* obj = createFunction(); 11 obj->method(); 12 } 13 14 template <typename T> 15 struct MemberVariable { 16 T* obj { nullptr }; 17 }; 18