update
This commit is contained in:
parent
965736b28f
commit
86cb5d5ffa
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// php-armadillo/subview_val.hh
|
||||
// php-armadillo/mapval.hh
|
||||
//
|
||||
// @Author CismonX
|
||||
//
|
||||
|
@ -41,7 +41,21 @@ namespace php_arma
|
|||
}
|
||||
}
|
||||
|
||||
static T get_val(zend_object*);
|
||||
zend_always_inline
|
||||
static zend_object *create(native_t init_val)
|
||||
{
|
||||
if constexpr(IsSparse) {
|
||||
return object_create<native_t>(ce, [&init_val](native_t *obj) {
|
||||
memcpy(obj, &init_val, sizeof(native_t));
|
||||
return &handlers;
|
||||
});
|
||||
} else {
|
||||
return object_create<native_t>(ce, [init_val](native_t *obj) {
|
||||
*obj = init_val;
|
||||
return &handlers;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
PHP_ARMA_CE_HANDLRES_DECLARE();
|
||||
|
||||
|
@ -49,6 +63,8 @@ namespace php_arma
|
|||
static ZEND_NAMED_FUNCTION(val);
|
||||
static ZEND_NAMED_FUNCTION(setTo);
|
||||
|
||||
static T get_val(zend_object*);
|
||||
|
||||
static void ce_init(const char*, zend_class_entry*);
|
||||
|
||||
PHP_ARMA_START_ME()
|
||||
|
|
Reference in New Issue
Block a user