I have been using curly brace initialisation more and more recently. Although I found a difference to round bracket initialisation in this case and I was wondering why.
If I do:
const std::string s(5, '=');
std::cout << s << std::endl;
I get:
=====
This is what I expect. But if I do:
const std::string s{5, '='};
std::cout << s << std::endl;
I get:
=
Why is this?
Edit: For the benefit for anyone that sees this. There is an unprintable character before the = in the second output. It just doesn't show on stackoverflow. Looks like:

This
uses the constructor taking a count and the character, ch (as well as an allocator):
But
uses
which means that
5will be converted to acharand your string will therefore have the size2. The first character will have the value5and the other will be=.