| 59 | //为继承Class创建实例 |
| 60 | template <class T, class U, typename... Args> |
| 61 | typename std::enable_if<std::is_base_of<T, U>::value, T*>::type Create(Args... args) |
| 62 | { |
| 63 | any constructor = GetDerivedFunction<T, U, Args...>(); |
| 64 | std::function<T*(Args && ...)> function = any_cast<std::function<T*(Args && ...)>>(constructor); |
| 65 | return function(std::forward<Args>(args)...); |
| 66 | } |
| 67 | //为简单Class创建实例,或Function Creator |
| 68 | template <class T, typename... Args> T* Create(Args... args) |
| 69 | { |
no outgoing calls