Replies: 2 comments 9 replies
-
So it is indeed true that the compiler can't infer the type statically. In this case, this can certainly be fixed, maybe with usage of the ValGraph(0, edgeval_types=..., vertexval_types) as it it is not always clear when keyword arguments are resolved at at runtime. I think this relies also a bit on const propagation, where there are no clear rules when that optimization is used. If it turns out that it is not possible to make the compiler infer the type statistically, there can always be the alternative constructor of the form ValGraph{V, V_VALS, E_VALS, G_VALS} This notation might just be a bit awkward to write. In any case, I don't think it is a big issue here, as when you call some function with your graph, i.e. There is another issue with type instability, and that is when you have a graph with multiple vertex values (or edge, graph values) of different types, then |
Beta Was this translation helpful? Give feedback.
-
Btw. I now fixed some of the constructor instability but its only on the master branch. |
Beta Was this translation helpful? Give feedback.
-
Hi there,
Following up on our discussion in Slack :) First of all, thanks for your work on this library!
I understand the purpose of these two types is to describe the storage of vertex and edge values. However, since the related fields are constructed using
typeof(...)
, I'm not sure the compiler is able to infer the types correctly. Here is an example supporting my hunch:What do you think? Could we make this better somehow?
Beta Was this translation helpful? Give feedback.
All reactions