I didn’t mean to emphasize any specific syntax. I’m fine with either @const, @constexpr, @pure or =>. Anyway, I see no reason why generic functions shouldn’t be supported in any of the suggested models.
2017-02-17 19:08 GMT+03:00 Abe Schneider <abe.schnei...@gmail.com>: +1. I think this is a great idea. As I was following this thread, I > was wondering if someone might suggest the C++ constexpr syntax. > > Would this support generics? E.g. could you do: > > @constepxr > func foo<S>(a:S, b:S) { > return a+b > } > > and have that be done at compile time? While this could potentially > add a huge amount of complication on the backend, I could this as > being useful (also related to my previous postings as to having a way > of determining generic types at compile time). >
_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution