Don't use `rcptr`s for function and opaque types
lhmouse opened this issue · 0 comments
At the moment, G_function
is an alias for rcptr<Abstract_Function>
and G_opaque
is an alias for rcptr<Abstract_Opaque>
.
Although the constructors and assignment operators of Value
are able to check for null pointers and convert them to null
values, I would like some other specific classes for them, especially G_function
.
Simple_Binding_Wrapper
itself is a derived class from Abstract_Function
so requires dynamic memory. However, all standard library functions are stateless, so the encapsulated Value
member turns out to be over-design. The description strings are also all static, so it could be replaced with a const char*
rather than cow_string
. This eliminates dynamic allocation of all standard library functions.