On Monday, 3 September 2012 at 14:04:18 UTC, Andrei Alexandrescu wrote:
A sufficiently smart compiler (tm) could
optimize this to a efficient string "prefix switch statement" just as well…

I agree. But then http://c2.com/cgi/wiki?SufficientlySmartCompiler.

This is exactly my point: My feeling is that the increased complexity by introducing a second syntax resp. a new special case (i.e. among) for such a simple operation is only worth it if it leaves no reason to revert to a hand-written replacement for performance reason, and I'm not sure if the signature taking runtime parameters is enough for that (without assuming such a sufficiently smart compiler).

David

Reply via email to