// // php-armadillo/instantiable.hh // // @Author CismonX // #ifndef PHP_ARMA_INSTANTIABLE_HH #define PHP_ARMA_INSTANTIABLE_HH #include "php_arma.hh" namespace php_arma { template struct instantiable; template struct instantiable { template zend_always_inline static zend_object *create(Ts&&... args) { return object_create_ctor(ChildT::ce, &ChildT::handlers, args...); } }; template struct instantiable { template zend_always_inline static zend_object *create(zval *parent, Ts&&... args) { auto zobj = object_create_ctor(ChildT::ce, &ChildT::handlers, args...); object_set_property(zobj, 0, parent); return zobj; } }; } #endif // !PHP_ARMA_INSTANTIABLE_HH