On Tue, Oct 5, 2021 at 8:12 AM Gawain Bolton via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
I would like to report what I will call "constructor ambiguity" for classes which have multiple constructors, one of which have takes an initializer list.
The ambiguity is for us humans, not the compiler, and is due to the two things:
  1. The same syntax is used for uniform initialization and initializer lists.
  2. Any constructor taking an initializer list is preferred when braces are used.

Yes, this is well-known. See for example
https://quuxplusone.github.io/blog/2019/02/18/knightmare-of-initialization/
From the end of that blog post:

Simple guidelines for variable initialization in C++:

  • Use = whenever you can.

  • Use initializer-list syntax {} only for element initializers (of containers and aggregates).

  • Use function-call syntax () to call a constructor, viewed as an object-factory.

In your examples, that would be
  std::string sa = std::string(32, 'A');
  std::string sb = {32, 'A'};
  std::vector<int> va = std::vector<int>(10, -1);
  std::vector<int> vb = {10, -1};

Of course `sa` and `va` could use `auto`; and in practice that's what I'd do, personally.

HTH,
Arthur