Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can someone explain how this "universal" syntax is supposed to be better than the old syntax?


T() had different meaninga depending on T and the context. It could be value initialisation, a cast, a function declaration(!). Also, when used with arguments, you couldn't use it to uniformly initialize aggregates and non aggregates, which is important in generic code.

The T{} syntax can be either a constructor call or aggregate initialization and never a cast or function definition.




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

Search: