-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tuple of tuple using global oplist #20
Comments
I can reproduce the issue. Thanks for the report! |
The issue should be solved in master. |
Ok, I can confirm that it fixes the toy example and my bigger code. A question: if I understood I can omit the oplist specifications also in macros like TUPLE_OPLIST (like in the toy example above). Right? If this is true I think that another bug is raising: it looks related to the automatic definition of the out_str method (with container elements supporting it). I'll try to create another related toy example. |
Here the example for the second bug:
Here the methods |
You cannot omit the oplist specifications in macros like TUPLE_OPLIST. Otherwise this macro will be conservative and will only provide the interfaces that are always defined by the tuples. This is true for all _OPLIST macro. Unfortunately, I don't know any way to avoid this constraint. I plan to add support for types in _OPLIST alongside oplist (so that it will try to get a global defined one), but it is not supported yet. |
Ok, but I don't understand why the following example looks to work even if the last two OPLISTs are defined without further specifications:
In this case the _out_str methods looks defined... |
The only interface that will read the oplists defined by M_OPL_my_list_of_tuple_t() and M_OPL_my_tuple_of_tuple_t() is the macro M_LET. M_LET only needs an interface that provides the INIT & CLEAR & TYPE operators. And all oplist provide the methods of theses operators. Therefore, you can omit it in this case and it will still work. In summary:
However, I think it is safer to always define the OPLIST with the proper sub-oplists. |
Ok, thanks for the details. Closing this. |
I'm trying to switch my code to use the possibility to use globally defined oplists without specification during definition of containers and related oplist declaration. I guessed this new feature from the commit names: is it missing in README.md?
During such switch I think I've found some kind of bug. I'm able to define an array of tuples like this:
but at this point I can't define a tuple containing another tuple:
I get an error like:
error: use of undeclared identifier 'm_no_default_function'
I've not tested other combinations of containers.
The text was updated successfully, but these errors were encountered: