"Resolve type by string" feature #30
-
I like the idea of a library, but I think there is one feature that would improve its use: the ability to resolve a type by name.
of course, it requires adding the name "rectangle" to But that adds enormous flexibility to the library. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
So, we have similar functionality in this library. I call these scopes. You can think of it like regular C++ namespaces. I've written a little example how to use it here: Scopes Scopes provide more advanced functionality than regular type naming. Also, this approach helps to avoid ambiguities of the same names in different namespaces or typedefs. And, of course, you can do a for-each loop over all types in a scope and bind it to a scripting language or whatever. In addition, you can add some free-form information about types, functions, parameters, etc. The library has the ability to do this using metadata functions and types. I don't have examples of this functionality right how, but you can find it in unit-tests. |
Beta Was this translation helpful? Give feedback.
So, we have similar functionality in this library. I call these scopes. You can think of it like regular C++ namespaces.
I've written a little example how to use it here: Scopes
Scopes provide more advanced functionality than regular type naming. Also, this approach helps to avoid ambiguities of the same names in different namespaces or typedefs.
And, of course, you can do a for-each loop over all types in a scope and bind it to a scripting language or whatever.
In addition, you can add some free-form information about types, functions, parameters, etc. The library has the ability to do this using metadata functions and types. I don't have examples of this functionality right how, but you…