MCPcopy Create free account
hub / github.com/OAID/Tengine / Create

Method Create

include/utilities/class_factory.hpp:61–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 3

test_creatorFunction · 0.45
test_constructorFunction · 0.45
test_interfaceFunction · 0.45

Calls

no outgoing calls

Tested by 3

test_creatorFunction · 0.36
test_constructorFunction · 0.36
test_interfaceFunction · 0.36