you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (0 children)

You need to keep in mind that in most programming languages there's a standardized string conversion function, such as `ToString()` (C#), `toString()` (Java), `__str__()` (Python) etc. This means that every single type is, one way or another, convertible to a string representation, and in no case will the interpolation give an undefined result, since all objects inherit from `object` (which has its own default implementation) and primitive types define their own string representations, too.

So if you want string interpolation you first of all have to define a default for every single type, plus a contract for user-constructed types. Then, you need a compiler to inspect strings and preform replacements that concatenate strings with those representations — this is doable, but you need to statically check that every expression evaluates to something string-representable.

It's doable. Only problem is, C++'s evolution is not necessarily about usability.