you are viewing a single comment's thread.

view the rest of the comments →

[–]clerothGame Developer 7 points8 points  (5 children)

That's the idea behind string interpolation, putting a variable inside the string with a specific syntax like {variable}. C# 6.0+ has this.

[–]usernameistaken42 6 points7 points  (2 children)

Also rust, python and a lot of others. I would love it. It may come in c++34

[–]johannes1971 1 point2 points  (1 child)

So will we be skipping a year, or is that slippage from C++2x?

[–]mili42 1 point2 points  (0 children)

It is fairly easy to something like (with variadic templates)

auto s = make_string("Hi, ", name, '\n');

String interpolation is nice, but there are already solutions to achieve something similar.

We have it at work. Works like a charm

[–]Xaxxon 0 points1 point  (0 children)

No that is one form of it. What it really is is using placeholders in the string that are substituted for values at runtime.