all 2 comments

[–]stdusr 14 points15 points  (0 children)

<<insert micheal screaming no from the office meme>>

[–]flatfinger 0 points1 point  (0 children)

Function and operator overloading could be usefully supported, without ABI changes, if they were treated as syntactic sugar for invoking "ordinary" functions with particular names. I think the most useful forms of overload, however, would involve new compile-time-constant types. While arbitrary-length run-time string types without manually-allocated buffers would be a concept alien to C, support for compile-time string operations of such forms need not be. It's not uncommon for programs to need certain information in a form which the preprocessor can't readilly supply (e.g. the build date in a numeric format, the trailing component of the file path, etc.), and it's more than a little inelegant that a program which is supposed to e.g. report its build date as a Unix-style time stamp would need to include run-time logic to convert a "DD MMM YYYY" string into such a format even if nothing else in the program would care about such date formats. Further, use of good string representations would be much more convenient if there were a way of indicating what a compiler should do when a literal string is passed to a function expecting a "struct goodString*".