In a struct!
In a struct! Pseudo code for extracting the types from subclasses and calling a multimethod on them: template <typename Result, typename Head, typename ...Tail> struct Foo : Visitor { Result res; UntypedList lst; // This does not exist! Tail... tail; // This is not possible! Foo(UntypedList l; Head hd, Tail... tl) : lst(l), tail(tl) { hd->accept(*this); } void visit(float *f) { res = Foo<Result, Tail...>(append(lst, f), tail)::res; } } }; // Base case that calls the multimethod omitted. There are two issues here: You can't store the parameter pack in Foo() which is later required by the continuation in visit(). And you would have to use tuples and tuple_cat() instead of UntypedList. Why can the compiler not infer the types in such an UntypedList? Why is there no car/cdr for tuples?
Posted by jasfas on Sep 14, 2024, 6:17 PM
Tags
Related issues
- That isn't really relevant for the tool starting the container.
- Why is there no link to the source?
- Something I wonder about in this domain is if this is the fault of the language.
- Namespace pollution is an annoying problem in Rust.
- Currently, no language ports of Timefold Solver are planned.
- I agree with you, almost all .NET code I write is within the .NET framework, yet when I look at C# repos, it's disheartening to see so ma...
Raise real-world problems, find people facing the same issue, and discuss solutions.7,000 issues0 comments
hackernews (Software)
That isn't really relevant for the tool starting the container.
Why is there no link to the source?
Something I wonder about in this domain is if this is the fault of the language.
Namespace pollution is an annoying problem in Rust.
Currently, no language ports of Timefold Solver are planned.
I agree with you, almost all .NET code I write is within the .NET framework, yet when I look at C# repos, it's disheartening to see so ma...
Why is there no simple workaround for this?
I have been using https://github.com/jacktasia/dumb-jump to quickly jump to definitions.
In a struct!
In a struct! Pseudo code for extracting the types from subclasses and calling a multimethod on them: template <typename Result, typename Head, typename ...Tail> struct Foo : Visitor { Result res; UntypedList lst; // This does not exist! Tail... tail; // This is not possible! Foo(UntypedList l; Head hd, Tail... tl) : lst(l), tail(tl) { hd->accept(*this); } void visit(float *f) { res = Foo<Result, Tail...>(append(lst, f), tail)::res; } } }; // Base case that calls the multimethod omitted. There are two issues here: You can't store the parameter pack in Foo() which is later required by the continuation in visit(). And you would have to use tuples and tuple_cat() instead of UntypedList. Why can the compiler not infer the types in such an UntypedList? Why is there no car/cdr for tuples?
Comments (0)
No comments yet. Start the discussion.