Hacker News new | past | comments | ask | show | jobs | submit login

C++ templates are similar to macros: they run at compile time to generate code, but they're a lot harder to use.



True, but in this case, the template serves a different purpose from the macro. It's there to make zap polymorphic, and would be unnecessary in a dynamic or type-inferred language. The main point is that pg's macro can be implemented as an ordinary function in a language that has references.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: