Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
account42
1y ago
0 comments
Share
That's not polymorphism as that template parameter won't be deduced in any context and you will always have to explicitly instantiate the template.
0 comments
default
newest
oldest
Maxatar
1y ago
That is still polymorphic, but as I mentioned C++ does not do the kind of type deduction that Haskell supports so you do have to explicitly instantiate the template. However, you can instantiate it based on context, for example using decltype.
gpderetta
1y ago
challenge accepted:
https://gcc.godbolt.org/z/bGdP79aEj
edit: you get pseudo call-by-name as a bonus.
j
/
k
navigate · click thread line to collapse