Get vector push_back_ref working as expected
This commit is contained in:
parent
84554ed0a5
commit
ad69bf7d38
@ -467,6 +467,7 @@ namespace chaiscript
|
|||||||
m->add(fun(&Boxed_Value::is_ref), "is_var_reference");
|
m->add(fun(&Boxed_Value::is_ref), "is_var_reference");
|
||||||
m->add(fun(&Boxed_Value::is_pointer), "is_var_pointer");
|
m->add(fun(&Boxed_Value::is_pointer), "is_var_pointer");
|
||||||
m->add(fun(&Boxed_Value::is_return_value), "is_var_return_value");
|
m->add(fun(&Boxed_Value::is_return_value), "is_var_return_value");
|
||||||
|
m->add(fun(&Boxed_Value::reset_return_value), "reset_var_return_value");
|
||||||
m->add(fun(&Boxed_Value::is_type), "is_type");
|
m->add(fun(&Boxed_Value::is_type), "is_type");
|
||||||
m->add(fun(&Boxed_Value::get_attr), "get_var_attr");
|
m->add(fun(&Boxed_Value::get_attr), "get_var_attr");
|
||||||
m->add(fun(&Boxed_Value::copy_attrs), "copy_var_attrs");
|
m->add(fun(&Boxed_Value::copy_attrs), "copy_var_attrs");
|
||||||
|
@ -335,6 +335,7 @@ namespace chaiscript
|
|||||||
"def push_back(" + type + " container, x)\n"
|
"def push_back(" + type + " container, x)\n"
|
||||||
"{ \n"
|
"{ \n"
|
||||||
" if (x.is_var_return_value()) {\n"
|
" if (x.is_var_return_value()) {\n"
|
||||||
|
" x.reset_var_return_value() \n"
|
||||||
" container.push_back_ref(x) \n"
|
" container.push_back_ref(x) \n"
|
||||||
" } else { \n"
|
" } else { \n"
|
||||||
" container.push_back_ref(clone(x)); \n"
|
" container.push_back_ref(clone(x)); \n"
|
||||||
@ -375,6 +376,7 @@ namespace chaiscript
|
|||||||
"def push_front(" + type + " container, x)\n"
|
"def push_front(" + type + " container, x)\n"
|
||||||
"{ \n"
|
"{ \n"
|
||||||
" if (x.is_var_return_value()) {\n"
|
" if (x.is_var_return_value()) {\n"
|
||||||
|
" x.reset_var_return_value() \n"
|
||||||
" container.push_front_ref(x) \n"
|
" container.push_front_ref(x) \n"
|
||||||
" } else { \n"
|
" } else { \n"
|
||||||
" container.push_front_ref(clone(x)); \n"
|
" container.push_front_ref(clone(x)); \n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user